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
public String formatMessage(LogRecord record) {
return format(record);
}
which seems naturally prone to causing grief through circular
references... (admittedly also not clear how to do things better).
Thus, instead of extending
ConsoleLogHandler to implement
formatting acceptable to XHTML, this extends
TextLogFormatter instead.
- Author:
- Christoph Hauert
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleantrueif 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 thatisXMListrue. -
Method Summary
Methods inherited from class FormatterImpl
getRecordInfo, getStackTraceAsStringMethods inherited from class Formatter
formatMessage, getHead, getTail
-
Field Details
-
isXML
private boolean isXMLtrueif 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-trueto show stack traces
-
TextLogFormatter
public TextLogFormatter(boolean showStackTraces, boolean isXML) Construct a new formatter for log messages with XML/XHTML encoding, provided thatisXMListrue.- Parameters:
showStackTraces-trueto show stack tracesisXML-trueto use XML/XHTML encoding
-
-
Method Details
-
format
If
isXMListruethe returned string is XML/XHTML compliant.- Overrides:
formatin classTextLogFormatter
-