title: How to remove all debug logging calls before building the release version of an Android app?
body: <p>According to Google, I must "<em>deactivate any calls to Log methods in the source code</em>" before publishing my Android app to Google Play. Extract from section 3 of the <a href="https://developer.android.com/studio/publish/preparing.html#turn-off-logging-and-debugging" rel="noreferrer">publication checklist</a>:</p>
  
  <blockquote>
    <p>Make sure you deactivate logging and disable the debugging option before you build your application for release. You can deactivate logging by removing calls to Log methods in your source files.</p>
  </blockquote>
  
  <p>My open-source project is large and it is a pain to do it manually every time I release. Additionally, removing a Log line is potentially tricky, for instance:</p>
  
  <pre><code>if(condition)
    Log.d(LOG_TAG, "Something");
  data.load();
  data.show();
  </code></pre>
  
  <p>If I comment the Log line, then the condition applies to the next line, and chances are load() is not called. Are such situations rare enough that I can decide it should not exist?</p>
  
  <p>So, is there a better source code-level way to do that? Or maybe some clever ProGuard syntax to efficiently but safely remove all Log lines?</p>