Skip to content

Instantly share code, notes, and snippets.

@JChudasama
Created August 11, 2015 16:32
Show Gist options
  • Save JChudasama/cbbf02d90f35fab3e609 to your computer and use it in GitHub Desktop.
Save JChudasama/cbbf02d90f35fab3e609 to your computer and use it in GitHub Desktop.
public final class Log {
public static boolean DEBUG = true;
public static String TAG = "TestDB";
public static void v(String msg) {
if (DEBUG)
android.util.Log.v(TAG, msg);
}
public static void v(Exception e) {
if (DEBUG) {
e.printStackTrace();
}
}
public static void v(String... args) {
if (DEBUG) {
StringBuffer strBuffer = new StringBuffer();
for (String temp : args) {
strBuffer.append(temp).append(" ");
}
android.util.Log.v(TAG, strBuffer.toString());
}
}
public static void e(String... args) {
if (DEBUG) {
android.util.Log.e(TAG, "------START--------");
v(args);
android.util.Log.e(TAG, "------END--------");
}
}
public static void e(String msg) {
if (DEBUG) {
android.util.Log.e(TAG, "------START--------");
v(msg);
android.util.Log.e(TAG, "------END--------");
}
}
public static void e(Exception e) {
if (DEBUG) {
android.util.Log.e(TAG, "------START--------");
v(e);
android.util.Log.e(TAG, "------END--------");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment