Skip to content

Instantly share code, notes, and snippets.

@ngima
Created November 19, 2018 06:35
Show Gist options
  • Save ngima/ead2d7d080b652994c046c84e903ab8a to your computer and use it in GitHub Desktop.
Save ngima/ead2d7d080b652994c046c84e903ab8a to your computer and use it in GitHub Desktop.
Android Logger Class
import android.util.Log;
public class Logger {
public static void d(String tag, String message) {
if (BuildConfig.DEBUG) Log.d(tag, message);
}
public static void e(String tag, String message) {
if (BuildConfig.DEBUG) Log.d(tag, message);
}
public static void i(String tag, String message) {
if (BuildConfig.DEBUG) Log.d(tag, message);
}
public static void v(String tag, String message) {
if (BuildConfig.DEBUG) Log.v(tag, message);
}
public static void w(String tag, String message) {
if (BuildConfig.DEBUG) Log.w(tag, message);
}
public static void wtf(String tag, String message) {
if (BuildConfig.DEBUG) Log.wtf(tag, message);
}
public static void d(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.d(tag, message, throwable);
}
public static void e(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.d(tag, message, throwable);
}
public static void i(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.d(tag, message, throwable);
}
public static void v(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.v(tag, message, throwable);
}
public static void w(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.w(tag, message, throwable);
}
public static void wtf(String tag, String message, Throwable throwable) {
if (BuildConfig.DEBUG) Log.wtf(tag, message, throwable);
}
public static void w(String tag, Throwable throwable) {
if (BuildConfig.DEBUG) Log.w(tag, throwable);
}
public static void wtf(String tag, Throwable throwable) {
if (BuildConfig.DEBUG) Log.wtf(tag, throwable);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment