Mobile/android
Easy logging switch between debug/release versions
퓨림노
2012. 1. 17. 23:04
Debug version of Config.java:
package com.test;
public class Config {
public static final boolean D = true;
public static final boolean V = true;
}
Release version of Config.java:
package com.test;
public class Config {
public static final boolean D = false;
public static final boolean V = false;
}
The build script can select one of them to build debug or release version.
In a class that wants to use the switch:
import static com.test.Config.D;
...
if (D) Log.d(TAG, ...);
Reference
http://www.androidsnippets.com/easy-logging-switch-between-debugrelease-versions