Created
November 11, 2015 04:37
-
-
Save VAdaihiep/1d1e81adc749c447252a to your computer and use it in GitHub Desktop.
Log auto turn off when build release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.util.Log; | |
import vn.mog.mygimi.BuildConfig; | |
/** | |
* Created by VAdaihiep on 11/11/2015. | |
*/ | |
public class MyLog { | |
public static String DEFAULT_TAG = "VAdaihiep"; | |
public static void d(String tag, String message) { | |
if (BuildConfig.DEBUG) { | |
Log.d(tag, message); | |
} | |
} | |
public static void e(String tag, String message) { | |
if (BuildConfig.DEBUG) { | |
Log.e(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 d(String message) { | |
d(DEFAULT_TAG, message); | |
} | |
public static void e(String message) { | |
e(DEFAULT_TAG, message); | |
} | |
public static void i(String message) { | |
i(DEFAULT_TAG, message); | |
} | |
public static void w(String message) { | |
w(DEFAULT_TAG, message); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment