Class LogHandler

java.lang.Object
java.util.logging.Handler
uk.ac.starlink.topcat.LogHandler

public class LogHandler extends Handler
Log handler which can provide a window displaying recent log events.
Since:
5 Aug 2021
Author:
Mark Taylor (Starlink)
  • Field Details

    • RING_SIZE

      public static final int RING_SIZE
      Maximum number of log records retained.
      See Also:
  • Constructor Details

    • LogHandler

      protected LogHandler()
      Constructor. Invoked lazily by getInstance().
  • Method Details

    • publish

      public void publish(LogRecord record)
      Specified by:
      publish in class Handler
    • flush

      public void flush()
      Specified by:
      flush in class Handler
    • close

      public void close()
      Specified by:
      close in class Handler
    • getRecordColor

      public Color getRecordColor(LogRecord record)
      Maps log records to display colours.
      Parameters:
      record - log record
      Returns:
      display colour
    • showWindow

      public void showWindow(Component parent)
      Displays a logging window which displays recent (the last 1000) and any future log messages.
      Parameters:
      parent - parent component, may be used for positioning
    • getInstance

      public static LogHandler getInstance()
      Returns the standard instance of this class.
      Returns:
      singleton handler