Class TextLogFormatter

Object
Formatter
FormatterImpl
TextLogFormatter
TextLogFormatter

public class TextLogFormatter extends 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

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    true if XML/XHTML compliant encoding of log messages desired.
  • Constructor Summary

    Constructors
    Constructor
    Description
    TextLogFormatter(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 that isXML is true.
  • Method Summary

    Modifier and Type
    Method
    Description
    format(LogRecord record)

    Methods inherited from class FormatterImpl

    getRecordInfo, getStackTraceAsString

    Methods inherited from class Formatter

    formatMessage, getHead, getTail

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • isXML

      private boolean isXML
      true 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 that isXML is true.
      Parameters:
      showStackTraces - true to show stack traces
      isXML - true to use XML/XHTML encoding
  • Method Details