Skip to content

Commit

Permalink
Merge pull request #52 from epaaj/patch-1
Browse files Browse the repository at this point in the history
Disabling logging when not in debugging mode
  • Loading branch information
justinelsberry committed Oct 29, 2014
2 parents 0b4a996 + a71a219 commit c5b1f96
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions android-rest/src/main/java/ly/apps/android/rest/utils/Logger.java
Expand Up @@ -20,25 +20,34 @@
package ly.apps.android.rest.utils;

import android.util.Log;
import ly.apps.android.rest.BuildConfig;

public class Logger {

public static final String TAG = "android-rest";

public static void e(String msg, Throwable t) {
Log.e(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg), t);
if (BuildConfig.DEBUG) {
Log.e(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg), t);
}
}

public static void v(String msg) {
Log.v(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
if (BuildConfig.DEBUG) {
Log.v(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
}
}

public static void w(String msg) {
Log.w(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
if (BuildConfig.DEBUG) {
Log.w(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
}
}

public static void d(String msg) {
Log.d(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
if (BuildConfig.DEBUG) {
Log.d(TAG, String.format("%s -> %s", Thread.currentThread().getName(), msg));
}
}

}

0 comments on commit c5b1f96

Please sign in to comment.