Package uk.ac.starlink.topcat
Class LogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- uk.ac.starlink.topcat.LogHandler
-
public class LogHandler extends java.util.logging.HandlerLog handler which can provide a window displaying recent log events.- Since:
- 5 Aug 2021
- Author:
- Mark Taylor (Starlink)
-
-
Field Summary
Fields Modifier and Type Field Description static intRING_SIZEMaximum number of log records retained.
-
Constructor Summary
Constructors Modifier Constructor Description protectedLogHandler()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidflush()static LogHandlergetInstance()Returns the standard instance of this class.java.awt.ColorgetRecordColor(java.util.logging.LogRecord record)Maps log records to display colours.voidpublish(java.util.logging.LogRecord record)voidshowWindow(java.awt.Component parent)Displays a logging window which displays recent (the last 1000) and any future log messages.
-
-
-
Field Detail
-
RING_SIZE
public static final int RING_SIZE
Maximum number of log records retained.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LogHandler
protected LogHandler()
Constructor. Invoked lazily bygetInstance().
-
-
Method Detail
-
publish
public void publish(java.util.logging.LogRecord record)
- Specified by:
publishin classjava.util.logging.Handler
-
flush
public void flush()
- Specified by:
flushin classjava.util.logging.Handler
-
close
public void close()
- Specified by:
closein classjava.util.logging.Handler
-
getRecordColor
public java.awt.Color getRecordColor(java.util.logging.LogRecord record)
Maps log records to display colours.- Parameters:
record- log record- Returns:
- display colour
-
showWindow
public void showWindow(java.awt.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
-
-