With this custom logger class we can disable all the logs with only one paramter and we can customize all the logs in the android application using this. We can disable this logs by setting false to DEBUGGING_BUILD,
public class Logger {
public static final String TAG = "SOW-Agent";
public static final boolean DEBUGGING_BUILD = true;
public static void debug(final String tag, final Object message) {
if (DEBUGGING_BUILD)
Log.d(tag, message.toString());
}
public static void info(final String tag, final String message) {
if (DEBUGGING_BUILD)
Log.i(tag, message);
}
public static void error(final String tag, final Object message) {
if (DEBUGGING_BUILD) {
Log.e(tag, "" + message.toString());
}
}
public static void error(final String tag, final Object message, final Throwable t) {
if (DEBUGGING_BUILD) {
Log.e(tag, message.toString(), t);
}
}
public static void error(final String tag, final String message,
final Throwable throwable) {
if (DEBUGGING_BUILD)
Log.e(tag, message, throwable);
}
}
