Created
July 23, 2020 13:44
-
-
Save niharika2810/eaf5b35b65b73883ef7714c57b3dffae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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