java.lang.Object
net.i2p.util.LogRecord
Keep track of a log entry, unformatted.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final longWhen the message was logged.private final StringThe message text.private final StringThe logger's name.private final intThe message's priority.private final Class<?> The class that logged the message.private final StringThe thread that logged the message.private final ThrowableThe exception logged with the message, if any.private static final intMessage prefix length used to match repeats.Constructor Summary
Method Summary
All MethodsModifier and TypeMethodDescriptionbooleanMatches source class, first part of message string, and throwable class only.longgetDate()Time the record was created.Message text.intLog priority of the record.Class<?> Class the record is from.Name the record is from.Thread the record was created on.Throwable attached to the record, if any.inthashCode()Hash code derived from the message.
Field Details
_date
private final long _dateWhen the message was logged._source
The class that logged the message._name
The logger's name._threadName
The thread that logged the message._priority
private final int _priorityThe message's priority._message
The message text._throwable
The exception logged with the message, if any.MATCH_LEN
private static final int MATCH_LENMessage prefix length used to match repeats.- See Also:
Constructor Details
LogRecord
public LogRecord(Class<?> src, String name, String threadName, int priority, String msg, Throwable t) Captures one log entry, stamping it with the current time.- Parameters:
src- the class the entry was logged fromname- the display name of the logger that wrote the entrythreadName- the name of the thread that logged itpriority- the message priority, one of the Log.WARN-style constantsmsg- the unformatted message textt- the associated exception, or null if the entry carries none
Method Details
getDate
public long getDate()Time the record was created.- Returns:
- the creation time in ms on the router clock
getSource
getSourceName
getThreadName
getPriority
public int getPriority()Log priority of the record.- Returns:
- one of the Log.WARN-style priority constants
getMessage
getThrowable
Throwable attached to the record, if any.- Returns:
- the associated exception, or null when the entry carries none
equals
hashCode