Search in sources :

Example 1 with AndroidLogHandler

use of com.jme3.util.AndroidLogHandler in project jmonkeyengine by jMonkeyEngine.

the class AndroidHarness method initializeLogHandler.

/**
     * Removes the standard Android log handler due to an issue with not logging
     * entries lower than INFO level and adds a handler that produces
     * JME formatted log messages.
     */
protected void initializeLogHandler() {
    Logger log = LogManager.getLogManager().getLogger("");
    for (Handler handler : log.getHandlers()) {
        if (log.getLevel() != null && log.getLevel().intValue() <= Level.FINE.intValue()) {
            Log.v("AndroidHarness", "Removing Handler class: " + handler.getClass().getName());
        }
        log.removeHandler(handler);
    }
    Handler handler = new AndroidLogHandler();
    log.addHandler(handler);
    handler.setLevel(Level.ALL);
}
Also used : AndroidLogHandler(com.jme3.util.AndroidLogHandler) AndroidLogHandler(com.jme3.util.AndroidLogHandler) Handler(java.util.logging.Handler) Logger(java.util.logging.Logger)

Example 2 with AndroidLogHandler

use of com.jme3.util.AndroidLogHandler in project jmonkeyengine by jMonkeyEngine.

the class AndroidHarnessFragment method initializeLogHandler.

/**
     * Removes the standard Android log handler due to an issue with not logging
     * entries lower than INFO level and adds a handler that produces
     * JME formatted log messages.
     */
protected void initializeLogHandler() {
    Logger log = LogManager.getLogManager().getLogger("");
    for (Handler handler : log.getHandlers()) {
        if (log.getLevel() != null && log.getLevel().intValue() <= Level.FINE.intValue()) {
            Log.v("AndroidHarness", "Removing Handler class: " + handler.getClass().getName());
        }
        log.removeHandler(handler);
    }
    Handler handler = new AndroidLogHandler();
    log.addHandler(handler);
    handler.setLevel(Level.ALL);
}
Also used : AndroidLogHandler(com.jme3.util.AndroidLogHandler) AndroidLogHandler(com.jme3.util.AndroidLogHandler) Handler(java.util.logging.Handler) Logger(java.util.logging.Logger)

Aggregations

AndroidLogHandler (com.jme3.util.AndroidLogHandler)2 Handler (java.util.logging.Handler)2 Logger (java.util.logging.Logger)2