Skip to content

Instantly share code, notes, and snippets.

@kojiokb
Created September 2, 2012 05:38
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 kojiokb/3595115 to your computer and use it in GitHub Desktop.
Save kojiokb/3595115 to your computer and use it in GitHub Desktop.
デバッグビルド時のみログを出力する
import android.util.Log;
public class DebugLog {
public static void v(String tag, String message) {
if (BuildConfig.DEBUG) {
Log.v(tag, message);
}
}
public static void d(String tag, String message) {
if (BuildConfig.DEBUG) {
Log.d(tag, message);
}
}
public static void i(String tag, String message) {
if (BuildConfig.DEBUG) {
Log.i(tag, message);
}
}
public static void w(String tag, String message) {
if (BuildConfig.DEBUG) {
Log.w(tag, message);
}
}
public static void e(String tag, String message) {
if (BuildConfig.DEBUG) {
Log.e(tag, message);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment