You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
811 B
34 lines
811 B
package xyz.wbsite.jmacro.util;
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
/**
|
|
* 日志记录器
|
|
* @author wangbing
|
|
* @version 0.0.1
|
|
* @since 1.8
|
|
*/
|
|
public class Logger {
|
|
|
|
public static boolean isDebug = false;
|
|
|
|
public static void setDebug(boolean isDebug) {
|
|
Logger.isDebug = isDebug;
|
|
}
|
|
|
|
public static void debug(String log, Object... arg) {
|
|
if (isDebug) {
|
|
System.out.println(DateUtil.date() + " " + StrUtil.format(log, arg));
|
|
}
|
|
}
|
|
|
|
public static void info(String log, Object... arg) {
|
|
System.out.println(DateUtil.date() + " " + StrUtil.format(log, arg));
|
|
}
|
|
|
|
public static void error(String log, Object... arg) {
|
|
System.err.println(DateUtil.date() + " " + StrUtil.format(log, arg));
|
|
}
|
|
}
|