All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ups.xmlsdk.util.logging.DefaultLogFormatter

java.lang.Object
   |
   +----com.ups.xmlsdk.util.logging.DefaultLogFormatter

public class DefaultLogFormatter
extends Object
implements LogFormatter
Implement a default log record formatting class.


Constructor Index

 o DefaultLogFormatter()

Method Index

 o appendAscii(int, StringBuffer, char)
Append a character to the buffer as a readable 7-bit US ASCII string.
 o format(StringBuffer, Date, String, int, String, String, long)
 o formatField(StringBuffer, String, int, boolean)
Make up for weak output formatting in java Format classes
 o formatHeader(StringBuffer, Date, String, int, String, boolean)
Format a log record header and append to the buffer.
 o formatMessage(int, StringBuffer, String, long)
Append a message and code to the buffer.
 o getMaxRecLen()
 o setMaxRecLen(int)

Constructors

 o DefaultLogFormatter
 public DefaultLogFormatter()

Methods

 o appendAscii
 public final int appendAscii(int spaceLeft,
                              StringBuffer buf,
                              char c)
Append a character to the buffer as a readable 7-bit US ASCII string. For characters in the range 0x20-0x7e, this is a single printable character, otherwise it is a 2-character ascii hex sequence of the form . For greater than 8-bit characters it is a 4-byte delimited hex sequence .

Returns:
the length in bytes of the appended string.
 o format
 public void format(StringBuffer buf,
                    Date time,
                    String facility,
                    int priority,
                    String id,
                    String msg,
                    long code) throws LogException
 o formatField
 public static StringBuffer formatField(StringBuffer sb,
                                        String s,
                                        int width,
                                        boolean left)
Make up for weak output formatting in java Format classes

 o formatHeader
 public void formatHeader(StringBuffer buf,
                          Date time,
                          String facility,
                          int priority,
                          String id,
                          boolean cont)
Format a log record header and append to the buffer.

 o formatMessage
 public String formatMessage(int hdrLen,
                             StringBuffer buf,
                             String msg,
                             long code)
Append a message and code to the buffer. If the record exceeds the allowable record length return a non-null String remainder.

 o getMaxRecLen
 public int getMaxRecLen()
 o setMaxRecLen
 public void setMaxRecLen(int m)

All Packages  Class Hierarchy  This Package  Previous  Next  Index