Interface FixedLevelLogger
public interface FixedLevelLogger
A logger that logs at a fixed
LogLevel
.-
Method Summary
Modifier and TypeMethodDescriptionboolean
Determine if the level is enabled.void
Log aString
corresponding level.void
Log a message at the corresponding level according to the specified format and argument.void
Log a message at the corresponding level according to the specified format and arguments.void
Log a message at the corresponding level according to the specified format and arguments.void
Log anException
at the corresponding level with an accompanying message.Get the logger name.logLevel()
Get the level of this logger.
-
Method Details
-
loggerName
String loggerName()Get the logger name.- Returns:
- the logger name.
-
logLevel
LogLevel logLevel()Get the level of this logger.- Returns:
- the level of this logger.
-
isEnabled
boolean isEnabled()Determine if the level is enabled.- Returns:
true
if the level is enabled.
-
log
Log aString
corresponding level.- Parameters:
msg
- the message to log.
-
log
Log anException
at the corresponding level with an accompanying message.- Parameters:
msg
- the message accompanying the exception.cause
- the exception (throwable) to log.
-
log
Log a message at the corresponding level according to the specified format and argument.This form avoids superfluous object creation when the logger is disabled for the corresponding level
- Parameters:
format
- the format string.arg
- the argument.
-
log
Log a message at the corresponding level according to the specified format and arguments.This form avoids superfluous object creation when the logger is disabled for the corresponding level.
- Parameters:
format
- the format string.arg1
- the first argument.arg2
- the second argument.
-
log
Log a message at the corresponding level according to the specified format and arguments.This form avoids superfluous string concatenation when the logger is disabled for the corresponding level. However, this variant incurs the hidden (and relatively small) cost of creating an
Object[]
before invoking the method, even if this logger is disabled for the corresponding level. The variants takingone
andtwo
arguments exist solely in order to avoid this hidden cost.- Parameters:
format
- the format string.args
- a list of 3 or more arguments.
-