Forward Computing and Control Pty. Ltd.
Logging Package V1.3.0

2004/11/22

au.com.forward.logging
Class RobustFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by au.com.forward.logging.RobustFormatter
Direct Known Subclasses:
LoggingSimpleFormatter, LoggingXMLFormatter

public abstract class RobustFormatter
extends java.util.logging.Formatter

A Robust formatter for LogRecords.

Author:
Matthew Ford

Constructor Summary
RobustFormatter()
           
 
Method Summary
 java.lang.String formatMessage(java.util.logging.LogRecord record)
          Format the message using resource bundle if available catch all possible errors and handle them here return the most information we can.
protected abstract  java.lang.String newLineString()
          Returns the newLine setting for this class
static java.lang.String toString(java.lang.Object obj)
          Return toString of object handling null inputs if obj is a Throwable returns the stack trace as a String.
 
Methods inherited from class java.util.logging.Formatter
format, getHead, getTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RobustFormatter

public RobustFormatter()
Method Detail

newLineString

protected abstract java.lang.String newLineString()
Returns the newLine setting for this class

Returns:
the string to use for new lines.

toString

public static java.lang.String toString(java.lang.Object obj)
Return toString of object handling null inputs if obj is a Throwable returns the stack trace as a String.

Parameters:
obj - the Object to convert to a String.
Returns:
"null" if obj is null, else the contents of stack trace if obj is a Throwable else obj.toString() If obj.toString() throws an exception then that exception and its stack trace are returned

formatMessage

public java.lang.String formatMessage(java.util.logging.LogRecord record)
Format the message using resource bundle if available catch all possible errors and handle them here return the most information we can.

Overrides:
formatMessage in class java.util.logging.Formatter
Parameters:
record - the log record to be formatted
Returns:
the string to log

Forward Computing and Control Pty. Ltd.
Logging Package V1.3.0

2004/11/22

Copyright ©2003, Forward Computing and Control Pty. Ltd
ACN 003 669 994   NSW Australia,   All Rights Reserved.
email:fcc@forward.com.au