Package org.jboss.logmanager
Class ExtFormatter
java.lang.Object
java.util.logging.Formatter
org.jboss.logmanager.ExtFormatter
- Direct Known Subclasses:
ExtFormatter.Delegating,MultistepFormatter,StructuredFormatter
A formatter which handles
ExtLogRecord instances.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA base class for formatters which wrap other formatters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Stringabstract Stringformat(ExtLogRecord record) Format a message using an extended log record.formatMessage(LogRecord record) protected StringformatMessageLegacy(LogRecord record) Format the message text as if there are no parameters.protected StringformatMessageNone(LogRecord record) Format the message text as if there are no parameters.protected StringformatMessagePrintf(LogRecord record) Format the message text as if there are no parameters.booleanDetermines whether or not this formatter will require caller, source level, information when a log record is formatted.static ExtFormatterWrap an existing formatter with anExtFormatter, optionally replacing message formatting with the default extended message formatting capability.
-
Constructor Details
-
ExtFormatter
public ExtFormatter()Construct a new instance.
-
-
Method Details
-
wrap
Wrap an existing formatter with anExtFormatter, optionally replacing message formatting with the default extended message formatting capability.- Parameters:
formatter- the formatter to wrap (must not benull)formatMessages-trueto replace message formatting,falseto let the original formatter do it- Returns:
- the extended formatter (not
null)
-
format
-
format
Format a message using an extended log record.- Parameters:
record- the log record- Returns:
- the formatted message
-
formatMessage
- Overrides:
formatMessagein classFormatter
-
isCallerCalculationRequired
public boolean isCallerCalculationRequired()Determines whether or not this formatter will require caller, source level, information when a log record is formatted.- Returns:
trueif the formatter will need caller information, otherwisefalse- See Also:
-
formatMessageNone
Format the message text as if there are no parameters. The default implementation delegates torecord.getMessage().- Parameters:
record- the record to format- Returns:
- the formatted string
-
formatMessageLegacy
Format the message text as if there are no parameters. The default implementation delegates toMessageFormat.format(record.getMessage(),record.getParameters()).- Parameters:
record- the record to format- Returns:
- the formatted string
-
formatMessagePrintf
Format the message text as if there are no parameters. The default implementation delegates toString.format(record.getMessage(),record.getParameters()).- Parameters:
record- the record to format- Returns:
- the formatted string
-