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

liquibase.logging.core.AbstractLogger Maven / Gradle / Ivy

There is a newer version: 4.30.0
Show newest version
package liquibase.logging.core;

import liquibase.exception.UnexpectedLiquibaseException;
import liquibase.logging.LogLevel;
import liquibase.logging.Logger;

public abstract class AbstractLogger  implements Logger {
    private LogLevel logLevel;

    public LogLevel getLogLevel() {
        return logLevel;
    }

    public void setLogLevel(String logLevel) {
        if ("debug".equalsIgnoreCase(logLevel)) {
            setLogLevel(LogLevel.DEBUG);
        } else if ("info".equalsIgnoreCase(logLevel)) {
            setLogLevel(LogLevel.INFO);
        } else if ("warning".equalsIgnoreCase(logLevel)) {
            setLogLevel(LogLevel.WARNING);
        } else if ("severe".equalsIgnoreCase(logLevel)) {
            setLogLevel(LogLevel.SEVERE);
        } else if ("off".equalsIgnoreCase(logLevel)) {
            setLogLevel(LogLevel.OFF);
        } else {
            throw new UnexpectedLiquibaseException("Unknown log level: " + logLevel+".  Valid levels are: debug, info, warning, severe, off");
        }
    }

    public void setLogLevel(LogLevel level) {
        this.logLevel = level;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy