Known Direct Subclasses
SimpleFormatter |
SimpleFormatter can be used to print a summary of the information
contained in a LogRecord object in a human readable format. |
XMLFormatter |
Formatter to convert a LogRecord into an XML string. |
|
Class Overview
Formatter
objects are used to format LogRecord
objects into a
string representation. Head and tail strings are sometimes used to wrap a set
of records. The getHead
and getTail
methods are used for this
purpose.
Summary
Protected Constructors |
|
Formatter()
Constructs a Formatter object.
|
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this Object .
|
boolean
|
equals(Object o)
Compares this instance with the specified object and indicates if they
are equal.
|
void
|
finalize()
Invoked when the garbage collector has detected that this instance is no longer reachable.
|
final
Class<?>
|
getClass()
Returns the unique instance of Class that represents this
object's class.
|
int
|
hashCode()
Returns an integer hash code for this object.
|
final
void
|
notify()
Causes a thread which is waiting on this object's monitor (by means of
calling one of the wait() methods) to be woken up.
|
final
void
|
notifyAll()
Causes all threads which are waiting on this object's monitor (by means
of calling one of the wait() methods) to be woken up.
|
String
|
toString()
Returns a string containing a concise, human-readable description of this
object.
|
final
void
|
wait()
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object.
|
final
void
|
wait(long millis, int nanos)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
final
void
|
wait(long millis)
Causes the calling thread to wait until another thread calls the notify() or notifyAll() method of this object or until the
specified timeout expires.
|
|
Protected Constructors
protected
Formatter
()
Constructs a Formatter
object.
Public Methods
Converts a LogRecord
object into a string representation. The
resulted string is usually localized and includes the message field of
the record.
Parameters
r
| the log record to be formatted into a string. |
Formats a LogRecord
object into a localized string
representation. This is a convenience method for subclasses of Formatter
.
The message string is firstly localized using the ResourceBundle
object associated with the supplied LogRecord
.
Notice : if message contains "{0", then java.text.MessageFormat is used.
Otherwise no formatting is performed.
Parameters
r
| the log record to be formatted. |
Returns
- the string resulted from the formatting.
Gets the head string used to wrap a set of log records. This base class
always returns an empty string.
Returns
- the head string used to wrap a set of log records, empty in this
implementation.
Gets the tail string used to wrap a set of log records. This base class
always returns the empty string.
Returns
- the tail string used to wrap a set of log records, empty in this
implementation.