Class XMLLogFormatter

Object
Formatter
FormatterImpl
TextLogFormatter
XMLLogFormatter

public class XMLLogFormatter 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 XML, this extends TextLogFormatter instead.

Author:
Christoph Hauert
  • Field Summary

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

    Constructors
    Constructor
    Description
    XMLLogFormatter(boolean showStackTraces)
    Construct a new formatter for log messages without XML/XHTML encoding.
    XMLLogFormatter(boolean showStackTraces, boolean isHTML)
    Construct a new formatter for log messages with XML/XHTML encoding, provided that isHTML is false.
  • Method Summary

    Modifier and Type
    Method
    Description

    Methods inherited from class com.google.gwt.logging.impl.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
      false if XML/XHTML compliant encoding of log messages desired.
  • Constructor Details

    • XMLLogFormatter

      public XMLLogFormatter(boolean showStackTraces)
      Construct a new formatter for log messages without XML/XHTML encoding.
      Parameters:
      showStackTraces - true to show stack traces
    • XMLLogFormatter

      public XMLLogFormatter(boolean showStackTraces, boolean isHTML)
      Construct a new formatter for log messages with XML/XHTML encoding, provided that isHTML is false.
      Parameters:
      showStackTraces - true to show stack traces
      isHTML - true to use HTML encoding
  • Method Details