public class DefaultLogger extends Object implements Logger, LogListener
Logger
.Constructor and Description |
---|
DefaultLogger(LogListener destination,
LogSource source,
int level) |
Modifier and Type | Method and Description |
---|---|
void |
addLogListener(LogListener listener)
Adds an item to the list of registered listeners.
|
void |
alwaysLog(int level,
Object msg,
Throwable t)
Logs a message with an exception.
|
int |
getLevel()
Returns the log level of this logger.
|
LogSource |
getSource()
Returns the
LogSource associated with this logger. |
void |
messageLogged(LogMessage message)
This method is normally called from many threads in parallel.
|
void |
notifyListeners(LogMessage message)
Broadcasts the given log message to the registered listeners.
|
void |
removeLogListener(LogListener listener)
Removes an item from the list of registered listeners.
|
Logger |
subLogger(String name,
int level)
Creates a sub logger, that forwards the message it gets to this logger.
|
public DefaultLogger(LogListener destination, LogSource source, int level)
public LogSource getSource()
Logger
LogSource
associated with this logger.public int getLevel()
Logger
LogLevel
public void alwaysLog(int level, Object msg, Throwable t)
Logger
Logger.getLevel()
).public Logger subLogger(String name, int level)
Logger
public void addLogListener(LogListener listener)
Logger
addLogListener
in interface Logger
public void removeLogListener(LogListener listener)
Logger
removeLogListener
in interface Logger
public void notifyListeners(LogMessage message)
Logger
notifyListeners
in interface Logger
public void messageLogged(LogMessage message)
LogListener
messageLogged
in interface LogListener
Copyright © 2015–2022 SciJava. All rights reserved.