public final class LogUtil {
public static final int DEBUG_LEVEL = 1;
private LogUtil() {
}
public static void v(String tag, String msg) {
if (Log.VERBOSE > DEBUG_LEVEL) {
Log.v(tag, msg);
}
}
public static void v(String tag, String msg, Throwable tr) {
if (Log.VERBOSE > DEBUG_LEVEL) {
Log.v(tag, msg, tr);
}
}
public static void d(String tag, String msg) {
if (Log.DEBUG > DEBUG_LEVEL) {
Log.d(tag, msg);
}
}
public static void d(String tag, String msg, Throwable tr) {
if (Log.DEBUG > DEBUG_LEVEL) {
Log.d(tag, msg, tr);
}
}
public static void i(String tag, String msg) {
if (Log.INFO > DEBUG_LEVEL) {
Log.i(tag, msg);
}
}
public static void i(String tag, String msg, Throwable tr) {
if (Log.INFO > DEBUG_LEVEL) {
Log.i(tag, msg, tr);
}
}
public static void w(String tag, String msg) {
if (Log.WARN > DEBUG_LEVEL) {
Log.w(tag, msg);
}
}
public static void w(String tag, Throwable tr) {
if (Log.WARN > DEBUG_LEVEL) {
Log.w(tag, tr);
}
}
public static void w(String tag, String msg, Throwable tr) {
if (Log.WARN > DEBUG_LEVEL) {
Log.w(tag, msg, tr);
}
}
public static void e(String tag, String msg) {
if (Log.ERROR > DEBUG_LEVEL) {
Log.e(tag, msg);
}
}
public static void e(String tag, String msg, Throwable tr) {
if (Log.ERROR > DEBUG_LEVEL) {
Log.e(tag, msg, tr);
}
}
}
Android 控制Log打印类
最新推荐文章于 2021-05-26 23:26:33 发布