com.go.trove.log
Class LogEvent

java.lang.Object
  |
  +--java.util.EventObject
        |
        +--com.go.trove.log.LogEvent
All Implemented Interfaces:
java.io.Serializable

public class LogEvent
extends java.util.EventObject

LogEvent captures information that should be logged. LogEvents are one of four types: debug, info, warn or error. All LogEvents have a timestamp for when the event occurred and a reference to the thread that created it. Most have an embedded message, and some have an embedded exception.

Version:
5 , 9/07/00
Author:
Brian S O'Neill
See Also:
Serialized Form

Field Summary
static int DEBUG_TYPE
          Debug type of LogEvent
static int ERROR_TYPE
          Error type of LogEvent
static int INFO_TYPE
          Info type of LogEvent
static int WARN_TYPE
          Warn type of LogEvent
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
LogEvent(Log log, int type, java.lang.String message)
           
LogEvent(Log log, int type, java.lang.String message, java.lang.Thread thread)
           
LogEvent(Log log, int type, java.lang.String message, java.lang.Thread thread, java.util.Date timestamp)
           
LogEvent(Log log, int type, java.lang.String message, java.lang.Throwable throwable)
           
LogEvent(Log log, int type, java.lang.String message, java.lang.Throwable throwable, java.lang.Thread thread, java.util.Date timestamp)
           
LogEvent(Log log, int type, java.lang.Throwable throwable)
           
LogEvent(Log log, int type, java.lang.Throwable throwable, java.lang.Thread thread)
           
LogEvent(Log log, int type, java.lang.Throwable throwable, java.lang.Thread thread, java.util.Date timestamp)
           
 
Method Summary
 java.lang.Throwable getException()
          Returns null if there is no exception logged.
 java.lang.String getExceptionStackTrace()
          Returns null if there is no exception logged.
 Log getLogSource()
           
 java.lang.String getMessage()
          Message may be null.
 java.lang.Thread getThread()
          Returns the thread that created this event, which may be null if this LogEvent was deserialized or the thread has been reclaimed.
 java.lang.String getThreadName()
          Returns the name of the thread that created this event.
 java.util.Date getTimestamp()
          Returns the date and time of this event.
 int getType()
          Returns the type of this LogEvent, which matches one of the defined type constants.
 java.lang.String toString()
           
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG_TYPE

public static final int DEBUG_TYPE
Debug type of LogEvent

INFO_TYPE

public static final int INFO_TYPE
Info type of LogEvent

WARN_TYPE

public static final int WARN_TYPE
Warn type of LogEvent

ERROR_TYPE

public static final int ERROR_TYPE
Error type of LogEvent
Constructor Detail

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.String message,
                java.lang.Throwable throwable,
                java.lang.Thread thread,
                java.util.Date timestamp)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.String message,
                java.lang.Thread thread,
                java.util.Date timestamp)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.Throwable throwable,
                java.lang.Thread thread,
                java.util.Date timestamp)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.String message,
                java.lang.Thread thread)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.Throwable throwable,
                java.lang.Thread thread)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.String message,
                java.lang.Throwable throwable)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.String message)

LogEvent

public LogEvent(Log log,
                int type,
                java.lang.Throwable throwable)
Method Detail

getLogSource

public Log getLogSource()

getType

public int getType()
Returns the type of this LogEvent, which matches one of the defined type constants.

getTimestamp

public java.util.Date getTimestamp()
Returns the date and time of this event.

getMessage

public java.lang.String getMessage()
Message may be null.

getException

public java.lang.Throwable getException()
Returns null if there is no exception logged.

getExceptionStackTrace

public java.lang.String getExceptionStackTrace()
Returns null if there is no exception logged.

getThreadName

public java.lang.String getThreadName()
Returns the name of the thread that created this event.

getThread

public java.lang.Thread getThread()
Returns the thread that created this event, which may be null if this LogEvent was deserialized or the thread has been reclaimed.

toString

public java.lang.String toString()
Overrides:
toString in class java.util.EventObject