All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cool.linco.common.log.util.CommonUtil Maven / Gradle / Ivy

package cool.linco.common.log.util;

import org.slf4j.Logger;
import org.slf4j.event.Level;

public class CommonUtil {

    public static boolean isTargetLogEnable(Logger log, Level level) {
        switch (level) {
            case INFO:
                return log.isInfoEnabled();
            case WARN:
                return log.isWarnEnabled();
            case DEBUG:
                return log.isDebugEnabled();
            case TRACE:
                return log.isTraceEnabled();
            case ERROR:
                return log.isErrorEnabled();
            default:
                return false;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy