1 *java.util.logging.Formatter* *Formatter* A Formatter provides support for forma
3 public abstract class Formatter
4 extends |java.lang.Object|
6 |java.util.logging.Formatter_Description|
7 |java.util.logging.Formatter_Fields|
8 |java.util.logging.Formatter_Constructors|
9 |java.util.logging.Formatter_Methods|
11 ================================================================================
13 *java.util.logging.Formatter_Constructors*
14 |java.util.logging.Formatter()|Construct a new formatter.
16 *java.util.logging.Formatter_Methods*
17 |java.util.logging.Formatter.format(LogRecord)|Format the given log record and
18 |java.util.logging.Formatter.formatMessage(LogRecord)|Localize and format the m
19 |java.util.logging.Formatter.getHead(Handler)|Return the header string for a se
20 |java.util.logging.Formatter.getTail(Handler)|Return the tail string for a set
22 *java.util.logging.Formatter_Description*
24 A Formatter provides support for formatting LogRecords.
26 Typically each logging Handler will have a Formatter associated with it. The
27 Formatter takes a LogRecord and converts it to a string.
29 Some formatters (such as the XMLFormatter) need to wrap head and tail strings
30 around a set of formatted records. The getHeader and getTail methods can be
31 used to obtain these strings.
34 *java.util.logging.Formatter()*
38 Construct a new formatter.
41 *java.util.logging.Formatter.format(LogRecord)*
43 public abstract |java.lang.String| format(java.util.logging.LogRecord record)
45 Format the given log record and return the formatted string.
47 The resulting formatted String will normally include a localized and formated
48 version of the LogRecord's message field. The Formatter.formatMessage
49 convenience method can (optionally) be used to localize and format the message
52 record - the log record to be formatted.
54 Returns: the formatted log record
55 *java.util.logging.Formatter.formatMessage(LogRecord)*
57 public synchronized |java.lang.String| formatMessage(java.util.logging.LogRecord record)
59 Localize and format the message string from a log record. This method is
60 provided as a convenience for Formatter subclasses to use when they are
61 performing formatting.
63 The message string is first localized to a format string using the record's
64 ResourceBundle. (If there is no ResourceBundle, or if the message key is not
65 found, then the key is used as the format string.) The format String uses
66 java.text style formatting.
68 If there are no parameters, no formatter is used. Otherwise, if the string
69 contains "{0" then java.text.MessageFormat is used to format the string.
70 Otherwise no formatting is performed.
74 record - the log record containing the raw message
76 Returns: a localized and formatted message
77 *java.util.logging.Formatter.getHead(Handler)*
79 public |java.lang.String| getHead(java.util.logging.Handler h)
81 Return the header string for a set of formatted records.
83 This base class returns an empty string, but this may be overriden by
86 h - The target handler (can be null)
88 Returns: header string
89 *java.util.logging.Formatter.getTail(Handler)*
91 public |java.lang.String| getTail(java.util.logging.Handler h)
93 Return the tail string for a set of formatted records.
95 This base class returns an empty string, but this may be overriden by
98 h - The target handler (can be null)