Back to project page SimpleReader.
The source code is released under:
Apache License
If you think the Android project SimpleReader listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.dreamteam.app.utils; //from w w w .j ava 2 s. com import android.util.Log; /** * ?????? ?????????????????????????????????????????? * * @author TangLong * @company ???? */ public class Logger { public static enum DebugLevel { ERROR { public int getValue() { return 0; } }, WARN { public int getValue() { return 1; } }, INFO { public int getValue() { return 2; } }, DEBUG { public int getValue() { return 3; } }; public abstract int getValue(); }; // ????????????????????????????? private static DebugLevel debugLevel = DebugLevel.DEBUG; // ??????? private static String TAG = "tag_default"; public static void error(String tag, String msg) { if (DebugLevel.ERROR.getValue() <= debugLevel.getValue()) { if (msg == null) { return; } Log.e(tag == null ? TAG : tag, msg); } } public static void warn(String tag, String msg) { if (DebugLevel.WARN.getValue() <= debugLevel.getValue()) { if (msg == null) { return; } Log.w(tag == null ? TAG : tag, msg); } } public static void info(String tag, String msg) { if (DebugLevel.INFO.getValue() <= debugLevel.getValue()) { if (msg == null) { return; } Log.i(tag == null ? TAG : tag, msg); } } public static void debug(String tag, String msg) { if (DebugLevel.DEBUG.getValue() <= debugLevel.getValue()) { if (msg == null) { return; } Log.d(tag == null ? TAG : tag, msg); } } }