Modifier and Type | Field and Description |
---|---|
private Logger |
delegate
The underlying
Logger instance to which logging
is delegated. |
private Level |
level
The level of this logger.
|
private Logger |
levelDelegate
The
Logger instance (if any) which provides the log level of this
instance. |
Constructor and Description |
---|
Logger(Logger delegate,
Level level)
Initializes a new
Logger instance with a given delegate and a
given log level. |
Logger(Logger delegate,
Logger levelDelegate)
|
Modifier and Type | Method and Description |
---|---|
void |
config(String msg)
Logs a message with level
Level.CONFIG , if that level is
loggable according to the log level configured for this Logger . |
void |
debug(String msg)
An alias for
fine(String) . |
void |
error(String msg)
An alias for
severe(String) . |
void |
fine(String msg)
Logs a message with level
Level.FINE , if that level is
loggable according to the log level configured for this Logger . |
void |
finer(String msg)
Logs a message with level
Level.FINER , if that level is
loggable according to the log level configured for this Logger . |
void |
finest(String msg)
Logs a message with level
Level.FINEST , if that level is
loggable according to the log level configured for this Logger . |
Level |
getLevel() |
void |
info(String msg)
Logs a message with level
Level.INFO , if that level is
loggable according to the log level configured for this Logger . |
boolean |
isLoggable(Level level)
Checks whether messages with a particular level should be logged
according to the log level configured for this
Logger . |
void |
log(Level level,
String msg)
Logs a message at a given level, if that level is loggable according to
the log level configured by this instance.
|
void |
log(Level level,
String msg,
Throwable thrown)
Logs a message at a given level, if that level is loggable according to
the log level configured by this instance.
|
void |
setLevel(Level level)
|
void |
severe(String msg)
Logs a message with level
Level.SEVERE , if that level is
loggable according to the log level configured for this Logger . |
void |
trace(String msg)
An alias for
finest(String) . |
void |
warn(String msg)
An alias for
warning(String) . |
void |
warning(String msg)
Logs a message with level
Level.WARNING , if that level is
loggable according to the log level configured for this Logger . |
private Level level
public Logger(Logger delegate, Level level)
Logger
instance with a given delegate and a
given log level.delegate
- the delegate.level
- the log level.public void setLevel(Level level)
level
- the level to set.public boolean isLoggable(Level level)
Logger
.level
- the log level.public void log(Level level, String msg)
level
- the level at which to log the message.msg
- the message to log.public void log(Level level, String msg, Throwable thrown)
level
- the level at which to log the message.msg
- the message to log.thrown
- a Throwable
associated with log message.public void severe(String msg)
Level.SEVERE
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void warning(String msg)
Level.WARNING
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void info(String msg)
Level.INFO
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void config(String msg)
Level.CONFIG
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void fine(String msg)
Level.FINE
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void finer(String msg)
Level.FINER
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void finest(String msg)
Level.FINEST
, if that level is
loggable according to the log level configured for this Logger
.msg
- the message to log.public void debug(String msg)
fine(String)
.public void warn(String msg)
warning(String)
.public void error(String msg)
severe(String)
.public void trace(String msg)
finest(String)
.Copyright © 2018. All rights reserved.