gps.util
Class LogFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by gps.util.LogFormatter

public class LogFormatter
extends java.util.logging.Formatter

formats log records

Version:
1.2, 6/20/2005
Author:
Weishuai Yang

Constructor Summary
LogFormatter()
          dummy constructor
LogFormatter(boolean debug)
          constructs a log formatter object
 
Method Summary
 java.lang.String format(java.util.logging.LogRecord record)
          Format the given LogRecord.
static void main(java.lang.String[] a)
          a test stub for the format class
static java.lang.String sprintf(java.lang.String fmt, char x)
          prints a formatted number following printf conventions
static java.lang.String sprintf(java.lang.String fmt, double x)
          prints a formatted number following printf conventions
static java.lang.String sprintf(java.lang.String fmt, long x)
          prints a formatted number following printf conventions
static java.lang.String sprintf(java.lang.String fmt, java.lang.String x)
          prints a formatted number following printf conventions
 
Methods inherited from class java.util.logging.Formatter
formatMessage, getHead, getTail
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogFormatter

public LogFormatter()
dummy constructor


LogFormatter

public LogFormatter(boolean debug)
constructs a log formatter object

Parameters:
debug - debug or not
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

sprintf

public static java.lang.String sprintf(java.lang.String fmt,
                                       double x)
prints a formatted number following printf conventions

Parameters:
fmt - the format string
x - the double to print
Returns:
the formated string

sprintf

public static java.lang.String sprintf(java.lang.String fmt,
                                       long x)
prints a formatted number following printf conventions

Parameters:
fmt - the format string
x - the long to print
Returns:
the formated string

sprintf

public static java.lang.String sprintf(java.lang.String fmt,
                                       char x)
prints a formatted number following printf conventions

Parameters:
fmt - the format string
x - the character to
Returns:
the formated string

sprintf

public static java.lang.String sprintf(java.lang.String fmt,
                                       java.lang.String x)
prints a formatted number following printf conventions

Parameters:
x - a string that represents the digits to print
Returns:
the formated string

main

public static void main(java.lang.String[] a)
a test stub for the format class