Constructor and Description |
---|
JULLogger(java.util.logging.Logger logger) |
Modifier and Type | Method and Description |
---|---|
void |
batch(java.util.function.Consumer<Logger> fn)
Write a set of log messages in a batch.
|
LogWriter |
debugWriter() |
LogWriter |
errorWriter() |
Level |
getLevel() |
LogWriter |
infoWriter() |
boolean |
isDebugEnabled() |
boolean |
isEnabled(Level level)
Check if a logging level is enabled.
|
boolean |
isErrorEnabled() |
boolean |
isInfoEnabled() |
boolean |
isWarnEnabled() |
LogWriter |
warnWriter() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debug, debugf, debugf, debugf, debugf, debugf, debugf, error, error, error, error, error, error, error, error, error, error, error, error, error, errorf, errorf, errorf, errorf, errorf, errorf, info, info, info, info, info, info, info, info, info, info, info, info, info, infof, infof, infof, infof, infof, infof, nullLogger, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warn, warnf, warnf, warnf, warnf, warnf, warnf, writer
public JULLogger(java.util.logging.Logger logger)
logger
- The java.util.logging.Logger
to output to.public Level getLevel()
public boolean isEnabled(Level level)
Logger
public boolean isErrorEnabled()
isErrorEnabled
in interface Logger
true
if the log level Level.ERROR
is enabled.public LogWriter errorWriter()
errorWriter
in interface Logger
LogWriter
that writes logs at level ERROR
.public boolean isWarnEnabled()
isWarnEnabled
in interface Logger
true
if the log level Level.WARN
is enabled.public LogWriter warnWriter()
warnWriter
in interface Logger
LogWriter
that writes logs at level WARN
.public boolean isInfoEnabled()
isInfoEnabled
in interface Logger
true
if the log level Level.INFO
is enabled.public LogWriter infoWriter()
infoWriter
in interface Logger
LogWriter
that writes logs at level INFO
.public boolean isDebugEnabled()
isDebugEnabled
in interface Logger
true
if the log level Level.DEBUG
is enabled.public LogWriter debugWriter()
debugWriter
in interface Logger
LogWriter
that writes logs at level DEBUG
.public void batch(java.util.function.Consumer<Logger> fn)
Logger
The specified Consumer
will be invoked with a Logger
that collects all log output and then writes
them all consecutively when the consumer invocation returns. Use this when a set of log lines must appear
consecutively in the log, regardless of time ordering.
Note: most implementations do not guarantee log ordering, so log lines may not always be ordered correctly by timestamp. This is especially true when logs are written in batch.