Search in sources :

Example 1 with LogLevel

use of org.cubeengine.logscribe.LogLevel in project core by CubeEngine.

the class Log4jProxyTarget method setProxyLevel.

@Override
public void setProxyLevel(LogLevel level) {
    Level l4jLevel = levelMap.get(level);
    if (l4jLevel == null) {
        l4jLevel = Level.INFO;
    }
    this.handle.setLevel(l4jLevel);
}
Also used : Level(org.apache.logging.log4j.Level) LogLevel(org.cubeengine.logscribe.LogLevel)

Example 2 with LogLevel

use of org.cubeengine.logscribe.LogLevel in project core by CubeEngine.

the class LogLevelParser method parse.

@Override
public LogLevel parse(Class type, CommandInvocation invocation) throws ParserException {
    String arg = invocation.consume(1);
    LogLevel logLevel = LogLevel.toLevel(arg);
    if (logLevel == null) {
        throw new TranslatedParserException(i18n.translate(invocation.getContext(Locale.class), MessageType.NEGATIVE, "The given log level is unknown."));
    }
    return logLevel;
}
Also used : TranslatedParserException(org.cubeengine.libcube.service.command.TranslatedParserException) LogLevel(org.cubeengine.logscribe.LogLevel)

Aggregations

LogLevel (org.cubeengine.logscribe.LogLevel)2 Level (org.apache.logging.log4j.Level)1 TranslatedParserException (org.cubeengine.libcube.service.command.TranslatedParserException)1