org.aitools.programd.logging
Class SimpleChatLogLayout

java.lang.Object
  extended by org.apache.log4j.Layout
      extended by org.apache.log4j.SimpleLayout
          extended by org.aitools.programd.logging.SimpleChatLogLayout
All Implemented Interfaces:
org.apache.log4j.spi.OptionHandler

public class SimpleChatLogLayout
extends org.apache.log4j.SimpleLayout

Formats a ChatLogEvent by printing a number of extra fields as we like them.

Since:
4.6
Author:
Noel Bush

Field Summary
private static java.lang.String LINE_SEPARATOR
           
private static java.lang.String RANGLE_BRACKET_SPACE
           
private static java.lang.String RBRACKET_SPACE
           
private  boolean showTimestamp
           
private  java.text.SimpleDateFormat timestampFormat
           
 
Fields inherited from class org.apache.log4j.Layout
LINE_SEP, LINE_SEP_LEN
 
Constructor Summary
SimpleChatLogLayout()
          Creates a new SimpleFormatter with the given Core settings.
 
Method Summary
 java.lang.String format(ChatLogEvent event)
           
 java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
          We insist that the event be a ChatLogEvent.
 void setTimestampFormat(java.lang.String format)
          Sets the timestamp format to the given format.
 
Methods inherited from class org.apache.log4j.SimpleLayout
activateOptions, ignoresThrowable
 
Methods inherited from class org.apache.log4j.Layout
getContentType, getFooter, getHeader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timestampFormat

private java.text.SimpleDateFormat timestampFormat

showTimestamp

private boolean showTimestamp

RBRACKET_SPACE

private static final java.lang.String RBRACKET_SPACE
See Also:
Constant Field Values

RANGLE_BRACKET_SPACE

private static final java.lang.String RANGLE_BRACKET_SPACE
See Also:
Constant Field Values

LINE_SEPARATOR

private static final java.lang.String LINE_SEPARATOR
Constructor Detail

SimpleChatLogLayout

public SimpleChatLogLayout()
Creates a new SimpleFormatter with the given Core settings.

Method Detail

setTimestampFormat

public void setTimestampFormat(java.lang.String format)
Sets the timestamp format to the given format.

Parameters:
format - the timestamp format to use

format

public java.lang.String format(org.apache.log4j.spi.LoggingEvent event)
We insist that the event be a ChatLogEvent.

Overrides:
format in class org.apache.log4j.SimpleLayout
Parameters:
event - the ChatLogEvent to format
Returns:
the result of formatting the given ChatLogEvent
Throws:
java.lang.IllegalArgumentException - if the record is not a ChatLogEvent

format

public java.lang.String format(ChatLogEvent event)
Parameters:
event - the ChatLogEvent to format
Returns:
the result of formatting the given ChatLogEvent