Skip to content

Instantly share code, notes, and snippets.

@niharika2810
Created July 23, 2020 13:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niharika2810/eaf5b35b65b73883ef7714c57b3dffae to your computer and use it in GitHub Desktop.
Save niharika2810/eaf5b35b65b73883ef7714c57b3dffae to your computer and use it in GitHub Desktop.
public class Logger {
private static boolean enableLog = BuildConfig.DEBUG;
public static boolean isEnableLog() {
return enableLog;
}
public static void setEnableLog(boolean enableLog) {
Logger.enableLog = enableLog;
}
public static void d(String tag, String msg) {
if (isEnableLog())
Log.d(tag, msg);
}
public static void e(String tag, String msg) {
if (isEnableLog())
Log.e(tag, msg);
}
public static void i(String tag, String msg) {
if (isEnableLog())
Log.i(tag, msg);
}
public static void v(String tag, String msg) {
if (isEnableLog())
Log.v(tag, msg);
}
public static void w(String tag, String msg) {
if (isEnableLog())
Log.w(tag, msg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment