Skip to content

Instantly share code, notes, and snippets.

@honjo2
Last active December 18, 2015 00:28
Show Gist options
  • Save honjo2/5696369 to your computer and use it in GitHub Desktop.
Save honjo2/5696369 to your computer and use it in GitHub Desktop.
AndroidのLogのよりシンプルなラッパー
public class Log {
public static void d(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.d(e.getClassName(), msg);
}
public static void e(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.e(e.getClassName(), msg);
}
public static void i(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.i(e.getClassName(), msg);
}
public static void v(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.v(e.getClassName(), msg);
}
public static void w(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.w(e.getClassName(), msg);
}
public static void wtf(String msg) {
StackTraceElement e = new Exception().getStackTrace()[1];
android.util.Log.wtf(e.getClassName(), msg);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment