Code example for ConsoleHandler

Methods: setFormatter, setLevel

0
    private final File localTemp = new File("/tmp/dalvikrunner/" + UUID.randomUUID());
 
    private DalvikRunner() {} 
 
    private void prepareLogging() { 
        ConsoleHandler handler = new ConsoleHandler();
        handler.setLevel(Level.ALL);
        handler.setFormatter(new Formatter() {
            @Override public String format(LogRecord r) {
                return r.getMessage() + "\n";
            } 
        }); 
        Logger logger = Logger.getLogger("dalvik.runner");
        logger.addHandler(handler);
        logger.setUseParentHandlers(false);
    } 
 
    private void run() { 
        Mode mode;
        if (options.mode.equals(Options.MODE_DEVICE)) {
            mode = new DeviceDalvikVm(