public final class LoggerSet extends Object implements Logger
When a logging facility (debug()
, error()
, etc.) is called, this implementation just redirects the call to every
registered logger.
This logger can be particularly useful for example to log information into a file and also to System streams :
workbench.getConfiguration().setLogger(new LoggerSet(new Logger[] { new FileLogger(new File("myFile.log")), new SystemStreamLogger() }));
Clients may instantiate this class.
Constructor and Description |
---|
LoggerSet(Logger[] loggers)
Constructs a new
LoggerSet that will dispatch log information to the specified loggers. |
Modifier and Type | Method and Description |
---|---|
void |
debug(Object message)
Logs a debug level message.
|
void |
debug(Object message,
String filename,
int lineNumber,
int columnNumber)
Logs a debug level message.
|
void |
debug(Object message,
Throwable error)
Logs a debug level message.
|
void |
error(Object message)
Logs an error level message.
|
void |
error(Object message,
String filename,
int lineNumber,
int columnNumber)
Logs an error level message.
|
void |
error(Object message,
Throwable error)
Logs an error level message.
|
Level |
getLevel()
Get the log Level that has been specified for this logger.
|
void |
info(Object message)
Logs an info level message.
|
void |
info(Object message,
String filename,
int lineNumber,
int columnNumber)
Logs an info level message, with the specified file location.
|
void |
info(Object message,
Throwable error)
Logs an info level message.
|
boolean |
isLoggable(Level level)
Check if a message of the given level would actually be logged by this logger.
|
void |
setLevel(Level level)
Set the log level specifying which message levels will be logged by this logger.
|
void |
warning(Object message)
Logs a warning level message.
|
void |
warning(Object message,
String filename,
int lineNumber,
int columnNumber)
Logs a warning level message.
|
void |
warning(Object message,
Throwable error)
Logs a warning level message.
|
public LoggerSet(Logger[] loggers)
LoggerSet
that will dispatch log information to the specified loggers.loggers
- the sub loggers this logger is in charge of.public Level getLevel()
Logger
INFO
.public void setLevel(Level level)
Logger
public boolean isLoggable(Level level)
Logger
isLoggable
in interface Logger
level
- a message logging level.true
if the given message level is currently being logged.public void debug(Object message)
Logger
Debug messages are used to assist in debugging problems that may be associated with particular configurations.
public void debug(Object message, String filename, int lineNumber, int columnNumber)
Logger
This method is typically used when parsing a model file and when a parsing debug information must be logged.
Debug messages are used to assist in debugging problems that may be associated with particular configurations.
public void debug(Object message, Throwable error)
Logger
Debug messages are used to assist in debugging problems that may be associated with particular configurations.
public void info(Object message)
Logger
Info messages should only be used for reasonably significant messages that will make sense to end users and system admins.
public void info(Object message, String filename, int lineNumber, int columnNumber)
Logger
This method is typically used when parsing a model file and when a parsing information must be logged.
Info messages should only be used for reasonably significant messages that will make sense to end users and system admins.
public void info(Object message, Throwable error)
Logger
Info messages should only be used for reasonably significant messages that will make sense to end users and system admins.
public void warning(Object message)
Logger
In general, warning messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
public void warning(Object message, String filename, int lineNumber, int columnNumber)
Logger
This method is typically used when parsing a model file and when a parsing warning must be logged.
In general, warning messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
public void warning(Object message, Throwable error)
Logger
In general, warning messages should describe events that will be of interest to end users or system managers, or which indicate potential problems.
public void error(Object message)
Logger
In general, error messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
public void error(Object message, String filename, int lineNumber, int columnNumber)
Logger
This method is typically used when parsing a model file and when a parsing recoverable error must be logged.
In general, error messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.
public void error(Object message, Throwable error)
Logger
In general, error messages should describe events that are of considerable importance and which will prevent normal program execution. They should be reasonably intelligible to end users and to system administrators.