Package com.openhtmltopdf.util
Class XRSimpleLogFormatter
java.lang.Object
java.util.logging.Formatter
com.openhtmltopdf.util.XRSimpleLogFormatter
A java.util.logging.Formatter class that writes a bare-bones log messages,
with no origin class name and no date/time.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private final MessageFormat
MessageFormat for messages with a throwableprivate final MessageFormat
MessageFormat for standard messages (without Throwable)private static final String
private final boolean[]
private final boolean[]
-
Constructor Summary
ConstructorsConstructorDescriptionXRSimpleLogFormatter
(String msgFmt, String throwableMsgFmt) Create a custom log formatter for use with:JDKXRLogger(boolean, Level, Handler, Formatter)
Options: {0} String.valueOf(record.getMillis()), {1} record.getLoggerName(), {2} record.getLevel().toString(), {3} record.getSourceClassName(), {4} record.getSourceMethodName(), {5} record.getMessage() {6} record.getThrown().getName() {7} record.getThrown().getMessage() {8} record.getThrown() stack trace Example (msgFmt):{1} {2}:: {5}\n
Example (throwableMsgFmt):{1} {2}:: {5} => {6}:: {7}\n
-
Method Summary
Modifier and TypeMethodDescriptionFormat the given log record and return the formatted string.formatMessage
(LogRecord record) Localize and format the message string from a log record.Return the header string for a set of formatted records.Return the tail string for a set of formatted records.private static boolean[]
usedPlaceholder
(MessageFormat messageFormat) Identify which arguments are effectively used.
-
Field Details
-
mformat
MessageFormat for standard messages (without Throwable) -
exmformat
MessageFormat for messages with a throwable -
MSG_FMT
- See Also:
-
EX_MSG_FMT
- See Also:
-
usedPlaceholderForMsgFmt
private final boolean[] usedPlaceholderForMsgFmt -
usedPlaceholderForExmsgFmt
private final boolean[] usedPlaceholderForExmsgFmt
-
-
Constructor Details
-
XRSimpleLogFormatter
public XRSimpleLogFormatter() -
XRSimpleLogFormatter
Create a custom log formatter for use with:JDKXRLogger(boolean, Level, Handler, Formatter)
Options:- {0} String.valueOf(record.getMillis()),
- {1} record.getLoggerName(),
- {2} record.getLevel().toString(),
- {3} record.getSourceClassName(),
- {4} record.getSourceMethodName(),
- {5} record.getMessage()
- {6} record.getThrown().getName()
- {7} record.getThrown().getMessage()
- {8} record.getThrown() stack trace
{1} {2}:: {5}\n
Example (throwableMsgFmt):{1} {2}:: {5} => {6}:: {7}\n
-
-
Method Details
-
usedPlaceholder
Identify which arguments are effectively used. -
format
Format the given log record and return the formatted string. -
formatMessage
Localize and format the message string from a log record.- Overrides:
formatMessage
in classFormatter
-
getHead
Return the header string for a set of formatted records. -
getTail
Return the tail string for a set of formatted records.
-