com.allen_sauer.gwt.log.shared
Class LogRecord

java.lang.Object
  extended by com.allen_sauer.gwt.log.shared.LogRecord
All Implemented Interfaces:
java.io.Serializable

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

Wrapper class to capture a single log message and optional stack trace, used primarily for transfer between client and server.

See Also:
Serialized Form

Constructor Summary
LogRecord(java.lang.String category, int level, java.lang.String message, java.lang.Throwable throwable)
          Constructor.
 
Method Summary
 java.lang.String getCategory()
           
 java.lang.String getFormattedMessage()
          Retrieve a formatted message for this log record.
 int getLevel()
          Retrieve the log level for this log record.
 java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getMapEntrySet()
          Retrieve the Set of key/value pairs for this log record, used for logging arbitrary data.
 java.lang.String getMessage()
          Retrieve this raw log record.
 WrappedClientThrowable getModifiableWrappedClientThrowable()
          Get the wrapped client throwable, suitable for serialization with RPC serialization code penalty.
 int getRecordSequence()
          Retrieve the global client-side or server-side sequence number for this log record.
 java.lang.Throwable getThrowable()
          Retrieves either the original (server side) throwable or a reconstituted client-side throwable.
 void set(java.lang.String key, java.lang.String value)
          Set a key/value pair associated with this log record.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogRecord

public LogRecord(java.lang.String category,
                 int level,
                 java.lang.String message,
                 java.lang.Throwable throwable)
Constructor.

Parameters:
category - The category in which this message should be logged
level - the level at which this message should be logged
message - the message to be logged
throwable - the stack trace associated with this message or null
Method Detail

getCategory

public java.lang.String getCategory()

getFormattedMessage

public java.lang.String getFormattedMessage()
Retrieve a formatted message for this log record.

Returns:
the formatted message

getLevel

public int getLevel()
Retrieve the log level for this log record.

Returns:
the log level

getMapEntrySet

public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getMapEntrySet()
Retrieve the Set of key/value pairs for this log record, used for logging arbitrary data.

Returns:
the Set of key/value pairs

getMessage

public java.lang.String getMessage()
Retrieve this raw log record.

Returns:
the raw log message

getModifiableWrappedClientThrowable

public WrappedClientThrowable getModifiableWrappedClientThrowable()
Get the wrapped client throwable, suitable for serialization with RPC serialization code penalty.

Returns:
the wrapped client throwable

getRecordSequence

public int getRecordSequence()
Retrieve the global client-side or server-side sequence number for this log record.

Returns:
the global client-side or server-side sequence number

getThrowable

public java.lang.Throwable getThrowable()
Retrieves either the original (server side) throwable or a reconstituted client-side throwable.

Returns:
the original or reconstituted throwable

set

public void set(java.lang.String key,
                java.lang.String value)
Set a key/value pair associated with this log record.

Parameters:
key - the unique key under which to store the supplied value
value - the value to be stored under the provided key