Added warn methods

This commit is contained in:
Collin Smith 2020-08-27 01:29:16 -07:00
parent 834d44ca3b
commit a3c99b6e66

View File

@ -45,6 +45,10 @@ abstract class AbstractLogger {
return enabled(Level.DEBUG);
}
public final boolean warnEnabled() {
return enabled(Level.WARN);
}
public final void trace(final String message, final Object... params) {
logIfEnabled(Level.TRACE, defaultFactory().newMessage(message, params), getLocation());
}
@ -53,6 +57,10 @@ abstract class AbstractLogger {
logIfEnabled(Level.DEBUG, defaultFactory().newMessage(message, params), getLocation());
}
public final void warn(final String message, final Object... params) {
logIfEnabled(Level.WARN, defaultFactory().newMessage(message, params), getLocation());
}
public final void tracef(final String message, final Object... params) {
logIfEnabled(Level.TRACE, formattedFactory().newMessage(message, params), getLocation());
}
@ -61,6 +69,10 @@ abstract class AbstractLogger {
logIfEnabled(Level.DEBUG, formattedFactory().newMessage(message, params), getLocation());
}
public final void warnf(final String message, final Object... params) {
logIfEnabled(Level.WARN, formattedFactory().newMessage(message, params), getLocation());
}
private StackTraceElement getLocation() {
return getLocation(FQCN);
}