org.deduced.utilities
Class LogFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by org.deduced.utilities.LogFormatter

public class LogFormatter
extends java.util.logging.Formatter

Log Formatter used in deduced applications.

Author:
Steve McDuff

Field Summary
private  java.lang.Object[] arguments
          list of arguments
private  java.util.Date date
          Date used for printing
private static java.lang.String FORMAT
          format to use while printing date
private  java.text.MessageFormat formatter
          Message formatter used for printing
private static java.lang.String LINE_SEPARATOR
          Line separator string.
 
Constructor Summary
LogFormatter()
           
 
Method Summary
 java.lang.String format(java.util.logging.LogRecord record)
          Format the given LogRecord.
private  void printException(java.util.logging.LogRecord record, java.lang.StringBuilder sb)
          print an exception stack trace in a log
 
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

date

private java.util.Date date
Date used for printing


FORMAT

private static final java.lang.String FORMAT
format to use while printing date

See Also:
Constant Field Values

formatter

private java.text.MessageFormat formatter
Message formatter used for printing


arguments

private java.lang.Object[] arguments
list of arguments


LINE_SEPARATOR

private static final java.lang.String LINE_SEPARATOR
Line separator string. This is the value of the line.separator property at the moment that the SimpleFormatter was created.

Constructor Detail

LogFormatter

public LogFormatter()
Method Detail

format

public java.lang.String format(java.util.logging.LogRecord record)
Format the given LogRecord.

Specified by:
format in class java.util.logging.Formatter
Parameters:
record - the log record to be formatted.
Returns:
a formatted log record

printException

private void printException(java.util.logging.LogRecord record,
                            java.lang.StringBuilder sb)
print an exception stack trace in a log

Parameters:
record - the log record
sb - the string builder in which to append the stack trace