Code example for Logger

Methods: isLoggable, log

0
            } 
 
            // device is connected to ADB 
            final AndroidDevice connectedDevice = deviceDiscovery.getDiscoveredDevice();
 
            logger.log(Level.INFO, "Serial number: " + connectedDevice.getSerialNumber());
 
            final String adbPath = androidSDK.get().getAdbPath();
            logger.log(Level.INFO, "adbPath: " + adbPath);
            final String serialNumber = connectedDevice.getSerialNumber();
            logger.log(Level.INFO, "serial number: " + serialNumber);
 
            isOnline = executor.scheduleUntilTrue(new Callable<Boolean>() {
                @Override 
                public Boolean call() throws Exception {
                    // check properties of underlying process 
                    List<String> props = executor.execute(Collections.<String, String> emptyMap(), adbPath,
                        "-s", serialNumber, "shell", "getprop");
                    for (String line : props) {
                        if (line.contains("[ro.runtime.firstboot]")) {
                            // boot is completed 
                            return true; 
                        } 
                    } 
                    return false; 
                } 
            }, countdown.timeLeft(), countdown.getTimeUnit().convert(1, TimeUnit.SECONDS), countdown.getTimeUnit());
 
            if (logger.isLoggable(Level.INFO)) {
                logger.log(Level.INFO, "Android emulator {0} was started within {1} seconds", new Object[] {
                    connectedDevice.getAvdName(), countdown.timeElapsed() });
            } 
 
            if (isOnline == false) {
                throw new AndroidExecutionException("Emulator device hasn't started properly in " + countdown.timeout()
                    + " seconds. Please increase the time limit in order to get emulator booted."); 
            } 
        } catch (InterruptedException e) {
            throw new AndroidExecutionException(e, "Emulator device startup failed.");
        } catch (ExecutionException e) {
            logger.log(Level.INFO, e.getCause().toString());
            throw new AndroidExecutionException(e, "Emulator device startup failed.");
        } 
    } 
 
    private class DeviceConnectDiscovery implements IDeviceChangeListener {