fix Mixin using Level.FATAL
All checks were successful
Publish to snapshot maven / build (push) Successful in 17s

slf4j does not have this log level
This commit is contained in:
moehreag 2024-06-11 00:27:41 +02:00
parent 5a65161113
commit eec8aaba57

View file

@ -30,17 +30,17 @@ public class FrogMixinLogger extends LoggerAdapterAbstract {
@Override @Override
public void catching(Level level, Throwable t) { public void catching(Level level, Throwable t) {
log.atLevel(org.slf4j.event.Level.valueOf(level.name())).setCause(t).log(); log.atLevel(getLevel(level)).setCause(t).log();
} }
@Override @Override
public void log(Level level, String message, Object... params) { public void log(Level level, String message, Object... params) {
log.atLevel(org.slf4j.event.Level.valueOf(level.name())).log(message, params); log.atLevel(getLevel(level)).log(message, params);
} }
@Override @Override
public void log(Level level, String message, Throwable t) { public void log(Level level, String message, Throwable t) {
log.atLevel(org.slf4j.event.Level.valueOf(level.name())).setCause(t).log(message); log.atLevel(getLevel(level)).setCause(t).log(message);
} }
@Override @Override
@ -48,4 +48,8 @@ public class FrogMixinLogger extends LoggerAdapterAbstract {
log.atLevel(org.slf4j.event.Level.WARN).setCause(t).log(); log.atLevel(org.slf4j.event.Level.WARN).setCause(t).log();
return t; return t;
} }
private org.slf4j.event.Level getLevel(Level level) {
return org.slf4j.event.Level.valueOf(level == Level.FATAL ? "ERROR" : level.toString());
}
} }