android自定义LogUtil
开发阶段设置为VERBOSE ,正式上线就设置为NOTHING
调用方式:LogUtil.d("TAG","debug log");
public class LogUtil { public static final int VERBOSE = 1; public static final int DEBUG = 2; public static final int INFO = 3; public static final int WARN = 4; public static final int ERROR = 5; public static final int NOTHING = 6; public static int level = VERBOSE; public static void v(String tag, String msg) { if (level <= VERBOSE) { Log.v(tag, msg); } } public static void d(String tag, String msg) { if (level <= DEBUG) { Log.v(tag, msg); } } public static void i(String tag, String msg) { if (level <= INFO) { Log.v(tag, msg); } } public static void w(String tag, String msg) { if (level <= WARN) { Log.v(tag, msg); } } public static void e(String tag, String msg) { if (level <= ERROR) { Log.v(tag, msg); } } }
相关推荐
零 2020-09-18
choupiaoyi 2020-07-28
Lzs 2020-10-23
聚合室 2020-11-16
Justhavefun 2020-10-22
jacktangj 2020-10-14
ChaITSimpleLove 2020-10-06
Andrea0 2020-09-18
周游列国之仕子 2020-09-15
afanti 2020-09-16
88234852 2020-09-15
YClimb 2020-09-15
风雨断肠人 2020-09-04
卖口粥湛蓝的天空 2020-09-15
stulen 2020-09-15
pythonxuexi 2020-09-06
abfdada 2020-08-26