Search in sources :

Example 1 with EventSubscriber

use of org.bushe.swing.event.annotation.EventSubscriber in project gfm_viewer by satyagraha.

the class LogManager method configChanged.

@EventSubscriber(eventClass = Config.Changed.class)
public void configChanged(Config.Changed configChanged) {
    Level level = debugging || config.useEclipseConsole() ? Level.FINE : Level.INFO;
    logger.setLevel(level);
    if (consoleHandler == null) {
        consoleHandler = new ConsoleHandler();
        consoleHandler.setFormatter(formatter);
        logger.addHandler(consoleHandler);
    }
    if (logConsoleHandler == null && config.useEclipseConsole()) {
        LogConsole.start(GFM_CONSOLE);
        logConsoleHandler = LogConsole.getInstance().createHandler(formatter);
        logger.addHandler(logConsoleHandler);
    }
    for (Handler handler : logger.getHandlers()) {
        handler.setLevel(level);
    }
}
Also used : ConsoleHandler(java.util.logging.ConsoleHandler) Handler(java.util.logging.Handler) Level(java.util.logging.Level) ConsoleHandler(java.util.logging.ConsoleHandler) EventSubscriber(org.bushe.swing.event.annotation.EventSubscriber)

Aggregations

ConsoleHandler (java.util.logging.ConsoleHandler)1 Handler (java.util.logging.Handler)1 Level (java.util.logging.Level)1 EventSubscriber (org.bushe.swing.event.annotation.EventSubscriber)1