Package uk.ac.starlink.topcat
Class LogHandler
java.lang.Object
java.util.logging.Handler
uk.ac.starlink.topcat.LogHandler
Log handler which can provide a window displaying recent log events.
- Since:
- 5 Aug 2021
- Author:
- Mark Taylor (Starlink)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum number of log records retained. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()static LogHandlerReturns the standard instance of this class.getRecordColor(LogRecord record) Maps log records to display colours.voidvoidshowWindow(Component parent) Displays a logging window which displays recent (the last 1000) and any future log messages.Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Field Details
-
RING_SIZE
public static final int RING_SIZEMaximum number of log records retained.- See Also:
-
-
Constructor Details
-
LogHandler
protected LogHandler()Constructor. Invoked lazily bygetInstance().
-
-
Method Details
-
publish
-
flush
public void flush() -
close
public void close() -
getRecordColor
Maps log records to display colours.- Parameters:
record- log record- Returns:
- display colour
-
showWindow
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
Returns the standard instance of this class.- Returns:
- singleton handler
-