Search in sources :

Example 1 with CompactFormatter

use of org.yamcs.CompactFormatter in project yamcs-studio by yamcs.

the class Application method configureLogging.

private void configureLogging() {
    Logger root = Logger.getLogger("");
    // We use the convention where INFO goes to end-user (via 'Console View' inside Yamcs Studio)
    // And FINE goes to stdout (--> debuggable by end-user if needed, and visible in PDE/UI)
    // By default only allow WARNING messages
    root.setLevel(Level.WARNING);
    // Exceptions only for plugins that do not flood the Console View with INFO messages:
    Logger.getLogger("com.spaceapplications").setLevel(Level.FINE);
    Logger.getLogger("org.csstudio").setLevel(Level.FINE);
    Logger.getLogger("org.yamcs.studio").setLevel(Level.FINE);
    // At this point in the startup there should be only one handler (for stdout)
    for (Handler handler : root.getHandlers()) {
        handler.setLevel(Level.FINE);
        handler.setFormatter(new CompactFormatter());
    }
// A second handler will be created by the workbench window advisor when the ConsoleView
// is available.
}
Also used : CompactFormatter(org.yamcs.CompactFormatter) Handler(java.util.logging.Handler) Logger(java.util.logging.Logger)

Aggregations

Handler (java.util.logging.Handler)1 Logger (java.util.logging.Logger)1 CompactFormatter (org.yamcs.CompactFormatter)1