Detect if App is Production/Release Version from Code
<p>I have a home made logging system in my app.  Of the things that it does is preform alot of logging (to file and logcat) while in development and can be turned off completely with one varible change.  For a functionality example:</p>

<pre><code>static public  final boolean DEVELOPMENT_VERBOSE = true;

public static void developmentLogMessage(String message) {
    if (DEVELOPMENT_VERBOSE)
        Log.i("com.xxx.app",  message);
}
</code></pre>

<p>The problem (maybe more an annoyance) I have is that I must remember to set <code>DEVELOPMENT_VERBOSE = false</code> for release.  Is there a way in code to detect when the app is finalized for release (say checking for a signed apk for example) so I can set <code>DEVELOPMENT_VERBOSE</code> to <code>false</code> programmatically?</p>

<p>I looked at <a href="http://stackoverflow.com/questions/986627/detect-if-app-was-downloaded-from-android-market">Detect if app was downloaded from Android Market</a> but it seems my app has a signature even before signing it for the market.</p>

<pre><code>try {
    PackageManager manager = context.getPackageManager(); 
    PackageInfo appInfo = manager.getPackageInfo(
                    "com.xxx.app", PackageManager.GET_SIGNATURES
        );

    System.out.println(appInfo.signatures[0].toCharsString());
} catch (NameNotFoundException e) {
}
</code></pre>

<p>I was hoping the signatures array would be empty and I could key of of that.  But no go.</p>
