Package org.evoludo.ui
Class TextLogFormatter
Object
Formatter
FormatterImpl
TextLogFormatter
TextLogFormatter
Formats LogRecords into XML/XHTML compliant text
Note: The GWT implementation of
Formatter
is simply
which seems naturally prone to causing grief through circular references... (admittedly also not clear how to do things better).public String formatMessage(LogRecord record) { return format(record); }
Thus, instead of extending
ConsoleLogHandler
to implement
formatting acceptable to XHTML, this extends
TextLogFormatter
instead.
- Author:
- Christoph Hauert
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
true
if XML/XHTML compliant encoding of log messages desired. -
Constructor Summary
ConstructorsConstructorDescriptionTextLogFormatter
(boolean showStackTraces) Construct a new formatter for log messages without XML/XHTML encoding.TextLogFormatter
(boolean showStackTraces, boolean isXML) Construct a new formatter for log messages with XML/XHTML encoding, provided thatisXML
istrue
. -
Method Summary
Methods inherited from class FormatterImpl
getRecordInfo, getStackTraceAsString
Methods inherited from class Formatter
formatMessage, getHead, getTail
-
Field Details
-
isXML
private boolean isXMLtrue
if XML/XHTML compliant encoding of log messages desired.
-
-
Constructor Details
-
TextLogFormatter
public TextLogFormatter(boolean showStackTraces) Construct a new formatter for log messages without XML/XHTML encoding.- Parameters:
showStackTraces
-true
to show stack traces
-
TextLogFormatter
public TextLogFormatter(boolean showStackTraces, boolean isXML) Construct a new formatter for log messages with XML/XHTML encoding, provided thatisXML
istrue
.- Parameters:
showStackTraces
-true
to show stack tracesisXML
-true
to use XML/XHTML encoding
-
-
Method Details
-
format
If
isXML
istrue
the returned string is XML/XHTML compliant.- Overrides:
format
in classTextLogFormatter
-