qflib 0.98.1

de.qfs.lib.log
Class LogEntry

java.lang.Object
  |
  +--de.qfs.lib.log.LogEntry
All Implemented Interfaces:
java.io.Serializable

public class LogEntry
extends java.lang.Object
implements java.io.Serializable

A LogEntry is a container for the elements of a log message.

Version:
$Revision: 1.11 $
Author:
Gregor Schmid
See Also:
Serialized Form

Constructor Summary
LogEntry(int level, long timestamp, java.lang.String thread, java.lang.String clazz, java.lang.String method, java.lang.String message)
          Construct a new LogEntry.
 
Method Summary
 java.lang.String getClazz()
           
 int getLevel()
           
 java.lang.String getMessage()
           
 java.lang.String getMethod()
           
 java.lang.String getThread()
           
 long getTimestamp()
           
 void setClazz(java.lang.String clazz)
          Set the clazz of the message.
 void setLevel(int level)
          Set the level of the message.
 void setMessage(java.lang.String message)
          Set the message.
 void setMethod(java.lang.String method)
          Set the method of the message.
 void setThread(java.lang.String thread)
          Set the thread of the message.
 void setTimestamp(long timestamp)
          Set the timestamp of the message.
 java.lang.String toString()
          Override the toString method to return a formatted String containing all the relevant data of the message.
 java.lang.String toString(java.text.DateFormat format)
          Deprecated. Please use the LogFormat interface to customize LogEntry output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LogEntry

public LogEntry(int level,
                long timestamp,
                java.lang.String thread,
                java.lang.String clazz,
                java.lang.String method,
                java.lang.String message)
Construct a new LogEntry.
Parameters:
level - The log level of the entry.
timestamp - The time of the entry in milliseconds.
thread - The thread that sent the message.
clazz - The class of the sender of the message.
method - The method that sent the message.
message - The message itself.
Method Detail

getLevel

public final int getLevel()
Returns:
The level of the message.

setLevel

public final void setLevel(int level)
Set the level of the message.
Parameters:
level - The level to set.

getThread

public final java.lang.String getThread()
Returns:
The originating thread.

setThread

public final void setThread(java.lang.String thread)
Set the thread of the message.
Parameters:
thread - The thread to set.

getTimestamp

public final long getTimestamp()
Returns:
The time the message was sent (from currentTimeMillis).

setTimestamp

public final void setTimestamp(long timestamp)
Set the timestamp of the message.
Parameters:
timestamp - The timestamp to set.

getClazz

public final java.lang.String getClazz()
Returns:
The name of the class that sent the message.

setClazz

public final void setClazz(java.lang.String clazz)
Set the clazz of the message.
Parameters:
clazz - The clazz to set.

getMethod

public final java.lang.String getMethod()
Returns:
The method that sent the message.

setMethod

public final void setMethod(java.lang.String method)
Set the method of the message.
Parameters:
method - The method to set.

getMessage

public final java.lang.String getMessage()
Returns:
The text of the message.

setMessage

public final void setMessage(java.lang.String message)
Set the message.
Parameters:
message - The message to set.

toString

public java.lang.String toString()
Override the toString method to return a formatted String containing all the relevant data of the message.
Overrides:
toString in class java.lang.Object
Returns:
The formatted message

toString

public java.lang.String toString(java.text.DateFormat format)
Deprecated. Please use the LogFormat interface to customize LogEntry output.

Print the LogEntry using a DateFormat for the timestamp.
Parameters:
format - The DateFormat to use.
Returns:
The formatted message

qflib 0.98.1