Android
java.util.logging
public abstract class

java.util.logging.Formatter

java.lang.Object
java.util.logging.Formatter

Formatter objects are used to format LogRecord objects into a string representation. Head and tail strings are sometime used to wrap a set of records. The getHead and getTail methods are presented for this purpose.

Known Direct Subclasses

Summary

Protected Constructors

            Formatter()
Constructs a Formatter object.

Public Methods

abstract          String  format(LogRecord r)
Formats a LogRecord object into a string representation.
          String  formatMessage(LogRecord r)
Formats a LogRecord object into a localized string representation.
          String  getHead(Handler h)
Gets the head string used to wrap a set of log records.
          String  getTail(Handler h)
Gets the tail string used to wrap a set of log records.
Methods inherited from class java.lang.Object

Details

Protected Constructors

protected Formatter()

Constructs a Formatter object.

Public Methods

public abstract String format(LogRecord r)

Formats a LogRecord object into a string representation. The resulted string is usually localized and includes the message field of the supplied LogRecord object.

Parameters

r the log record to be formatted into a string

Returns

  • the string resulted from the formatting

public String formatMessage(LogRecord r)

Formats a LogRecord object into a localized string representation. This method can be regarded as a convenience for subclasses of Formatter to use.

The message string is firstly localized using the ResourceBundle object associated with the supplied LogRecord.

Parameters

r the log record to be formatted

Returns

  • the string resulted from the formatting

public String getHead(Handler h)

Gets the head string used to wrap a set of log records. This base class always returns the empty string.

Parameters

h the target handler

Returns

  • the head string used to wrap a set of log records

public String getTail(Handler h)

Gets the tail string used to wrap a set of log records. This base class always returns the empty string.

Parameters

h the target handler

Returns

  • the tail string used to wrap a set of log records
Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:48