Package org.scijava.log
Class LogMessage
- java.lang.Object
-
- org.scijava.log.LogMessage
-
public class LogMessage extends Object
A log message broadcast by aLogger.NB: The message is published on the calling thread by
Logger.notifyListeners(org.scijava.log.LogMessage), not on a dedicated event dispatch thread by theEventService. This is done to avoid the overhead of the event service's synchronized pub/sub implementation, as well as to avoid potential infinite loops caused by debugging log messages surrounding event publication.- Author:
- Matthias Arzt
-
-
Constructor Summary
Constructors Constructor Description LogMessage(LogSource source, int level, Object msg)LogMessage(LogSource source, int level, Object message, Throwable throwable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattach(Object value)Attach object to this log message.Collection<Object>attachments()Collection of objects that have been attached to this message withattach(Object).intlevel()Log level of the message.LogSourcesource()Represents the source of the message.Stringtext()The content of this log message.Throwablethrowable()Exception associated with the log message.Datetime()Time of the creation of the log message.StringtoString()
-
-
-
Method Detail
-
source
public LogSource source()
Represents the source of the message.
-
level
public int level()
Log level of the message.- See Also:
LogLevel
-
text
public String text()
The content of this log message.
-
throwable
public Throwable throwable()
Exception associated with the log message.
-
time
public Date time()
Time of the creation of the log message.
-
attachments
public Collection<Object> attachments()
Collection of objects that have been attached to this message withattach(Object).
-
attach
public void attach(Object value)
Attach object to this log message. This can be used to attach additional information to the log message.
-
-