be.ugent.caagt.swirl.logging
Class JListLogHandler
Handler
be.ugent.caagt.swirl.logging.JListLogHandler
public class JListLogHandler
extends Handler
Log handler which outputs its log records to a
JList
, where
new records end up at the top.
The simplest way to use this class is by adding the following statement
to the start of the application
JListLogHandler.createDialog ("Log window", "");
This will make a window pop up with all logged messages, as soon as
a message of a sufficiently high level (a warning, by default) is sent to
the loggin system.
Configuration:
By default the handler is initialized using the following
LogManager
configuration properties.
- be.ugent.caagt.swirl.logging.JListLogHandler.level
specifies the default level for the handler (defaults to
java.util.logging.Level.INFO
).
- be.ugent.caagt.swirl.logging.JListLogHandler.filter
specifies the name of a
Filter
class to use (defaults to none).
- be.ugent.caagt.swirl.logging.JListLogHandler.formatter
specifies the name of a
Formatter
class to use
(defaults to SimpleFormatter
).
- be.ugent.caagt.swirl.logging.JListLogHandler.popupLevel specifies
the level for which the handler should try to draw the attention of the user
by showing the window which contains the list and bringing it to the front
JListLogHandler(JList jlist) - Create a log handler which shall send its output to the given list.
|
void | close()
|
static JDialog | createLoggingDialog(String title, String loggerName) - Create a dialog which contains a list which is handled by a new handler,
registered to the named logger of the application (use the empty string
for the root logger).
|
protected void | drawAttention() - Draw attention to the logging window.
|
void | flush()
|
Level | getPopupLevel() - Retrieve the popup log level, i.e., the minimum level
for which the handler will try to draw the attention of the user
by sounding a beep, making the parent window of the list visible
and moving it to the front.
|
void | publish(LogRecord record)
|
void | setPopupLevel(Level popupLevel) - Set the popup log level.
|
JListLogHandler
public JListLogHandler(JList jlist)
Create a log handler which shall send its output to the given list.
close
public void close()
throws SecurityException
createLoggingDialog
public static JDialog createLoggingDialog(String title,
String loggerName)
Create a dialog which contains a list which is handled by a new handler,
registered to the named logger of the application (use the empty string
for the root logger). Initially this dialog is not visible to the application.
drawAttention
protected void drawAttention()
Draw attention to the logging window.
getPopupLevel
public Level getPopupLevel()
Retrieve the popup log level, i.e., the minimum level
for which the handler will try to draw the attention of the user
by sounding a beep, making the parent window of the list visible
and moving it to the front.
publish
public void publish(LogRecord record)
setPopupLevel
public final void setPopupLevel(Level popupLevel)
Set the popup log level.