DebugLog.java revision cfd74d65d832137e20e193c960802afba73b5d38
1package com.replica.replicaisland; 2 3import android.util.Log; 4 5public final class DebugLog { 6 private static boolean mLoggingEnabled = true; 7 8 private DebugLog() { 9 10 } 11 12 public static void setDebugLogging(boolean enabled) { 13 mLoggingEnabled = enabled; 14 } 15 16 public static int v(String tag, String msg) { 17 int result = 0; 18 if (mLoggingEnabled) { 19 result = Log.v(tag, msg); 20 } 21 return result; 22 } 23 24 public static int v(String tag, String msg, Throwable tr) { 25 int result = 0; 26 if (mLoggingEnabled) { 27 result = Log.v(tag, msg, tr); 28 } 29 return result; 30 } 31 32 public static int d(String tag, String msg) { 33 int result = 0; 34 if (mLoggingEnabled) { 35 result = Log.d(tag, msg); 36 } 37 return result; 38 } 39 40 public static int d(String tag, String msg, Throwable tr) { 41 int result = 0; 42 if (mLoggingEnabled) { 43 result = Log.d(tag, msg, tr); 44 } 45 return result; 46 } 47 48 public static int i(String tag, String msg) { 49 int result = 0; 50 if (mLoggingEnabled) { 51 result = Log.i(tag, msg); 52 } 53 return result; 54 } 55 56 public static int i(String tag, String msg, Throwable tr) { 57 int result = 0; 58 if (mLoggingEnabled) { 59 result = Log.i(tag, msg, tr); 60 } 61 return result; 62 } 63 64 public static int w(String tag, String msg) { 65 int result = 0; 66 if (mLoggingEnabled) { 67 result = Log.w(tag, msg); 68 } 69 return result; 70 } 71 72 public static int w(String tag, String msg, Throwable tr) { 73 int result = 0; 74 if (mLoggingEnabled) { 75 result = Log.w(tag, msg, tr); 76 } 77 return result; 78 } 79 80 public static int w(String tag, Throwable tr) { 81 int result = 0; 82 if (mLoggingEnabled) { 83 result = Log.w(tag, tr); 84 } 85 return result; 86 } 87 88 public static int e(String tag, String msg) { 89 int result = 0; 90 if (mLoggingEnabled) { 91 result = Log.e(tag, msg); 92 } 93 return result; 94 } 95 96 public static int e(String tag, String msg, Throwable tr) { 97 int result = 0; 98 if (mLoggingEnabled) { 99 result = Log.e(tag, msg, tr); 100 } 101 return result; 102 } 103} 104