Skip to content

Commit

Permalink
- add proguard option
Browse files Browse the repository at this point in the history
  • Loading branch information
gun0912 committed Jul 6, 2016
1 parent dcb658c commit 787fdcc
Showing 1 changed file with 42 additions and 41 deletions.
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
package com.gun0912.tedpermission.util;

import android.util.Log;

import com.gun0912.tedpermission.BuildConfig;

public class Dlog {

static final String TAG = "tedpark";


/** Log Level Error **/
public static void e(String message) {
Log.e(TAG, buildLogMsg(message));
}
/** Log Level Warning **/
public static void w(String message) {
Log.w(TAG, buildLogMsg(message));
}
/** Log Level Information **/
public static void i(String message) {
Log.i(TAG, buildLogMsg(message));
}
/** Log Level Debug **/
public static void d(String message) {
Log.d(TAG, buildLogMsg(message));
}
/** Log Level Verbose **/
public static void v(String message){Log.v(TAG, buildLogMsg(message));
}


public static String buildLogMsg(String message) {

StackTraceElement ste = Thread.currentThread().getStackTrace()[4];

StringBuilder sb = new StringBuilder();

sb.append("[");
sb.append(ste.getFileName().replace(".java", ""));
sb.append("::");
sb.append(ste.getMethodName());
sb.append("]");
sb.append(message);

return sb.toString();

}
static final String TAG = "tedpark";

/** Log Level Error **/
public static void e(String message) {
if (BuildConfig.DEBUG) Log.e(TAG, buildLogMsg(message));
}

/** Log Level Warning **/
public static void w(String message) {
if (BuildConfig.DEBUG) Log.w(TAG, buildLogMsg(message));
}

/** Log Level Information **/
public static void i(String message) {
if (BuildConfig.DEBUG) Log.i(TAG, buildLogMsg(message));
}

/** Log Level Debug **/
public static void d(String message) {
if (BuildConfig.DEBUG) Log.d(TAG, buildLogMsg(message));
}

/** Log Level Verbose **/
public static void v(String message) {
if (BuildConfig.DEBUG) Log.v(TAG, buildLogMsg(message));
}

public static String buildLogMsg(String message) {

StackTraceElement ste = Thread.currentThread().getStackTrace()[4];

StringBuilder sb = new StringBuilder();

sb.append("[");
sb.append(ste.getFileName().replace(".java", ""));
sb.append("::");
sb.append(ste.getMethodName());
sb.append("]");
sb.append(message);

return sb.toString();
}
}

0 comments on commit 787fdcc

Please sign in to comment.