-
-
Save vaibhav-jani/21ad640ce07c6d1b477db2862dc6a342 to your computer and use it in GitHub Desktop.
Android Log wrapper
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
import android.content.Context; | |
import android.util.Log; | |
public class Logger { | |
private static final boolean shouldLog = true; | |
public static void i(String tag, String msg) { | |
if(shouldLog) { | |
Log.i(tag, msg); | |
} | |
} | |
public static void d(String tag, String msg) { | |
if(shouldLog) { | |
Log.d(tag, msg); | |
} | |
} | |
public static void e(String tag, String msg) { | |
if(shouldLog) { | |
Log.e(tag, msg); | |
} | |
} | |
public static void v(String tag, String msg) { | |
if(shouldLog) { | |
Log.v(tag, msg); | |
} | |
} | |
public static void e(Throwable e) { | |
if(shouldLog) { | |
e.printStackTrace(); | |
} | |
} | |
public static void toast(String string, Context context) { | |
if(shouldLog) { | |
Notify.toast(string, context); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment