Package org.yamcs.studio.core.ui.logging
Class ConsoleViewHandler
java.lang.Object
java.util.logging.Handler
org.yamcs.studio.core.ui.logging.ConsoleViewHandler
Log handler that displays messages in the Eclipse Console view.
The MessageConsoleStream
description mentions buffering and appears thread-safe, but lockups have been
observed if multiple threads try to access the console streams. This handler therefore logs in the UI thread, using
the Display
that was available on initialization. This is suitable for RCP, but not RAP.
-
Method Summary
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
-
Method Details
-
install
Add console view to the (root) logger.To be called from Eclipse application's
WorkbenchWindowAdvisor.postWindowCreate()
. Calling it earlier is not possible because the necessary console view infrastructure is not available, yet.Calling it much later means log messages are lost.
Only the first call has an effect. Subsequent calls as they can happen when opening multiple windows of the same Eclipse instance will have no effect.
- Returns:
-
publish
-
flush
public void flush() -
close
Usually called by JRE when Logger shuts down, i.e. way after the Eclipse shutdown has already closed the console view- Specified by:
close
in classHandler
- Throws:
SecurityException
-