Created
December 5, 2018 07:43
-
-
Save yusuphwickama/a8b04027f1ceeb3f325f4f74ef00a585 to your computer and use it in GitHub Desktop.
A logger that works only when the app is in debug mode.
This file contains 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; | |
public class Logger { | |
private static final String TAG = "LOGGER"; | |
public static void debug(String msg) { | |
if (BuildConfig.DEBUG) { | |
Log.d(TAG, "[+] ".concat(msg)); | |
} | |
} | |
public static void error(String msg) { | |
if (BuildConfig.DEBUG) { | |
Log.d(TAG, "[!] ERROR-".concat(msg)); | |
} | |
} | |
public static void info(String msg) { | |
if (BuildConfig.DEBUG) { | |
Log.d(TAG, msg); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment