Class TextOrGUIHandler

java.lang.Object
java.util.logging.Handler
com.xinapse.util.logging.TextOrGUIHandler

class TextOrGUIHandler extends Handler
A TextOrGUIHandler publishes log records to:
  • In text mode, either:
    • System.err (for Levels of WARN or higher), or
    • System.out for lower Levels.
  • In GUI mode, the pop-up Error Console, but also duplicates SEVERE and WARNING messages to System.err.

The formatter used is a XinapseFormatter.

  • Method Details

    • setLevel

      public void setLevel(Level level)
      Overrides:
      setLevel in class Handler
    • publish

      public void publish(LogRecord logRecord)
      Publishes a LogRecord, provided the record passes all tests for being loggable.

      Most applications do not need to call this method directly. Instead, they will use a Logger, which will create LogRecords and distribute them to registered handlers.

      This implementation of publish calls flush() for every request to publish a record, so they appear immediately.

      Specified by:
      publish in class Handler
      Parameters:
      logRecord - the log event to be published.
    • flush

      public void flush()
      Forces any data that may have been buffered to the underlying output devices, but does not close System.out or System.err.

      In case of an I/O failure, the ErrorManagers of this TextOrGUIHandler will be informed, but the caller of this method will not receive an exception.

      Specified by:
      flush in class Handler
    • close

      public void close()
      Forces any data that may have been buffered to the underlying output devices, but does not close System.out or System.err.

      In case of an I/O failure, the ErrorManagers of this TextOrGUIHandler will be informed, but the caller of this method will not receive an exception.

      Specified by:
      close in class Handler