package com.example.jmacro.wjdr.util;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;

public class Logger {

    private 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));
    }
}
