Debug mode in a library
<p>I have an Android application with several "Log.d" calls along the code in order to following the events of the app.
In order to enable or disable the debug messages I call the Log with</p>

<pre><code> if (MyApp.debug) Log.d("Doing something");
</code></pre>

<p>Where MyApp.debug is a final boolean that I change before compiling.</p>

<p>Now I want to use some classes from the application as a library for another app, so I copied them into a new library project. The problem is that now in the library I have no a MyApp class.</p>

<p>How can I make something similar for controlling from the app if the library must print the debug messages or not?</p>

<p>Thanks in advance</p>
