Class LogPane

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, ScrollPaneConstants

public class LogPane extends TextPaneScrollPane
A color-coded log display hosted inside the application's LogView.

Overview

LogPane extends TextPaneScrollPane and registers itself as an ILogListener with the Log singleton at construction time. Each log level is rendered in a distinct color and font so messages can be scanned at a glance:

  • INFO — black, sans-serif
  • CONFIG — blue, sans-serif
  • WARNING — orange-red, monospaced, italic
  • ERROR — red, sans-serif, italic
  • EXCEPTION — red, monospaced, italic (smaller; stack traces are verbose)

Threading

Log messages may arrive from any thread. All Swing text-pane mutations are dispatched to the EDT via SwingUtilities.invokeLater(java.lang.Runnable) so this class is safe to use from background threads.

Lifecycle

The listener registered in the constructor is held by the Log singleton for the lifetime of the application. If the LogPane is ever removed from the UI it will continue to receive log messages; call detach() to unregister the listener.

See Also:
  • Constructor Details

    • LogPane

      public LogPane()
      Construct a LogPane and register it with the Log singleton.

      The pane begins receiving messages immediately after construction. Call detach() if you need to stop receiving messages without disposing the component.

  • Method Details

    • detach

      public void detach()
      Unregister this pane's listener from the Log singleton.

      After this call the pane stops receiving new log messages but retains whatever content it has already displayed. The component itself remains usable (e.g. the user can still scroll and read existing messages).