org.jscience.util.logging
Class LogEntry

java.lang.Object
  extended by org.jscience.util.logging.LogEntry
All Implemented Interfaces:
java.io.Serializable

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

LogEntry represents a single record of a log logged by a Logger object and handled by a LogWriter object. As opposed to java.util.logging.LogRecord, this class also maintains a stack trace. Note on serialization: as this class contains an array of Object, the serialization of an instance may throw an IOException if one of the contained objects is not serializable. A workaround may be to use the Object.toString() function to serialize the object; this could either be done through subclassing or through the LogWriter object that handles the serialization.

See Also:
Logger, LogWriter, Serialized Form

Constructor Summary
LogEntry()
          Creates a new LogEntry object.
LogEntry(Level level, java.lang.String message, long time, java.lang.String sourceClassName, java.lang.String sourceString, java.lang.Throwable thrown, java.lang.String threadName, java.lang.StackTraceElement[] stack, java.lang.Object... parameters)
          Creates a new LogEntry object.
 
Method Summary
 Level getLevel()
          DOCUMENT ME!
 java.lang.String getMessage()
          DOCUMENT ME!
 java.lang.Object[] getParameters()
          DOCUMENT ME!
 java.lang.Class getSourceClass()
          uses the context class loader of the current thread
 java.lang.Class getSourceClass(java.lang.ClassLoader classLoader)
          DOCUMENT ME!
 java.lang.String getSourceClassName()
          DOCUMENT ME!
 java.lang.String getSourceString()
          DOCUMENT ME!
 java.lang.StackTraceElement[] getStackTrace()
          DOCUMENT ME!
 java.lang.String getThreadName()
          DOCUMENT ME!
 java.lang.Throwable getThrown()
          DOCUMENT ME!
 long getTime()
          DOCUMENT ME!
 void setLevel(Level level)
          DOCUMENT ME!
 void setMessage(java.lang.String message)
          DOCUMENT ME!
 void setParameters(java.lang.Object[] parameters)
          DOCUMENT ME!
 void setSourceClassName(java.lang.String sourceClassName)
          DOCUMENT ME!
 void setSourceString(java.lang.String sourceString)
          DOCUMENT ME!
 void setStackTrace(java.lang.StackTraceElement[] stack)
          DOCUMENT ME!
 void setThreadName(java.lang.String threadName)
          DOCUMENT ME!
 void setThrown(java.lang.Throwable thrown)
          DOCUMENT ME!
 void setTime(long time)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogEntry

public LogEntry()
Creates a new LogEntry object.


LogEntry

public LogEntry(Level level,
                java.lang.String message,
                long time,
                java.lang.String sourceClassName,
                java.lang.String sourceString,
                java.lang.Throwable thrown,
                java.lang.String threadName,
                java.lang.StackTraceElement[] stack,
                java.lang.Object... parameters)
Creates a new LogEntry object.

Parameters:
level - DOCUMENT ME!
message - DOCUMENT ME!
time - DOCUMENT ME!
sourceClassName - DOCUMENT ME!
sourceString - DOCUMENT ME!
thrown - DOCUMENT ME!
threadName - DOCUMENT ME!
stack - DOCUMENT ME!
Method Detail

getLevel

public Level getLevel()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setLevel

public void setLevel(Level level)
DOCUMENT ME!

Parameters:
level - DOCUMENT ME!

getMessage

public java.lang.String getMessage()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setMessage

public void setMessage(java.lang.String message)
DOCUMENT ME!

Parameters:
message - DOCUMENT ME!

getTime

public long getTime()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setTime

public void setTime(long time)
DOCUMENT ME!

Parameters:
time - DOCUMENT ME!

getSourceString

public java.lang.String getSourceString()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setSourceString

public void setSourceString(java.lang.String sourceString)
DOCUMENT ME!

Parameters:
sourceString - DOCUMENT ME!

getSourceClassName

public java.lang.String getSourceClassName()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getSourceClass

public java.lang.Class getSourceClass()
                               throws java.lang.ClassNotFoundException
uses the context class loader of the current thread

Returns:
DOCUMENT ME!
Throws:
java.lang.ClassNotFoundException - DOCUMENT ME!

getSourceClass

public java.lang.Class getSourceClass(java.lang.ClassLoader classLoader)
                               throws java.lang.ClassNotFoundException
DOCUMENT ME!

Parameters:
classLoader - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
java.lang.ClassNotFoundException - DOCUMENT ME!

setSourceClassName

public void setSourceClassName(java.lang.String sourceClassName)
DOCUMENT ME!

Parameters:
sourceClassName - DOCUMENT ME!

getThrown

public java.lang.Throwable getThrown()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setThrown

public void setThrown(java.lang.Throwable thrown)
DOCUMENT ME!

Parameters:
thrown - DOCUMENT ME!

getThreadName

public java.lang.String getThreadName()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setThreadName

public void setThreadName(java.lang.String threadName)
DOCUMENT ME!

Parameters:
threadName - DOCUMENT ME!

getStackTrace

public java.lang.StackTraceElement[] getStackTrace()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setStackTrace

public void setStackTrace(java.lang.StackTraceElement[] stack)
DOCUMENT ME!

Parameters:
stack - DOCUMENT ME!

getParameters

public java.lang.Object[] getParameters()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setParameters

public void setParameters(java.lang.Object[] parameters)
DOCUMENT ME!

Parameters:
parameters - DOCUMENT ME!