@Override public void receiveMessage( Message message ) { logger.info( message .toString() ); // TBD anything else to do? }
@Override public SyncIssue handleIssue( String data, int type, int i1, String msg ) { logger.info( "Sync Error. Data: " + data + "\tmsg: " + msg ); return new SyncIssueImpl( 0, type, data, msg ); }
command.addAll( processInfo.getArgs() ); String commandString = Joiner.on( ' ' ).join( command ); mLogger.info( "command: " + commandString ); try
@Override public void processNewLines(String[] lines) { for (String line : lines) { logger.info(line); } }
private void printBuffer() throws UnsupportedEncodingException { if (nextByteIndex == 0) { return; } String line = new String(buffer, 0, nextByteIndex, "UTF-8"); if (logToInfo) { logger.info(line); } nextByteIndex = 0; }
/** * Prints a line to stdout. * This is protected so that it can be overridden in unit tests. * * @param format The string to be formatted. Cannot be null. * @param args Format arguments. */ protected void stdout(String format, Object...args) { String output = String.format(format, args); output = LineUtil.reflowLine(output); mLog.info("%s\n", output); //$NON-NLS-1$ }
public void waitForReady() throws InterruptedException { if (!mReadyLatch.await(TimeUnit.NANOSECONDS.convert( SLAVE_AAPT_TIMEOUT_IN_SECONDS, TimeUnit.SECONDS))) { throw new RuntimeException("Timed out while waiting for slave aapt process, " + "try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than " + SLAVE_AAPT_TIMEOUT_IN_SECONDS + " seconds"); } mLogger.info("Slave %1$s is ready", hashCode()); }
@Override public void testRunStarted(String runName, int testCount) { if (mLogger != null) { mLogger.info("Starting %1$d tests on %2$s", testCount, mDeviceName); } super.testRunStarted(runName, testCount); }
/** * Displays the tags & ABIs valid for the given images. */ private void displayTagAbiList(Collection<SystemImage> systemImages, String message) { mSdkLog.info(message); if (!systemImages.isEmpty()) { boolean first = true; for (ISystemImage si : systemImages) { if (!first) { mSdkLog.info(", "); } else { first = false; } mSdkLog.info("%s/%s", si.getTag().getId(), si.getAbiType()); } mSdkLog.info("\n"); } else { mSdkLog.info("no ABIs.\n"); } }
@Override public void testRunStarted(String runName, int testCount) { if (mLogger != null) { mLogger.info("Starting %1$d tests on %2$s", testCount, mDeviceName); } super.testRunStarted(runName, testCount); }
@Override public void info(@NonNull String msgFormat, Object... args) { mDelegate.info(msgFormat, args); }
@Override public void logInfo(@NonNull String s) { mWrapped.info(s); }
public synchronized void clear(@Nullable File itemStorage, @Nullable ILogger logger) throws IOException { if (!mMap.isEmpty()) { if (itemStorage != null) { saveItems(itemStorage); } if (logger != null) { logger.info("PREDEX CACHE HITS: " + mHits); logger.info("PREDEX CACHE MISSES: " + mMisses); } } mMap.clear(); mStoredItems.clear(); mHits = 0; mMisses = 0; }
@Override public void testEnded(TestIdentifier test, Map<String, String> testMetrics) { if (!mFailedTests.remove(test)) { // if wasn't present in the list, then the test succeeded. if (mLogger != null) { mLogger.info("\n%1$s > %2$s[%3$s] \033[32mSUCCESS \033[0m", test.getClassName(), test.getTestName(), mDeviceName); } } super.testEnded(test, testMetrics); }
public DiffType getModifyType(String bundleSoFileName) { for (ArtifactBundleInfo artifactBundleInfo : input.artifactBundleInfos) { String packageName = artifactBundleInfo.getPkgName(); if (null == packageName) { return DiffType.NONE; } String bundleName = "lib" + packageName.replace('.', '_') + ".so"; if (bundleName.equals(bundleSoFileName)) { if (null != logger) { logger.info("[BundleDiffType]" + bundleSoFileName + ":" + artifactBundleInfo.getDiffType()); } return artifactBundleInfo.getDiffType(); } } return DiffType.NONE; }
/** * Creates a new {@link com.android.builder.png.QueuedCruncher} or return an existing one * based on the underlying AAPT executable location. * @param aaptLocation the APPT executable location. * @param logger the logger to use * @return a new of existing instance of the {@link com.android.builder.png.QueuedCruncher} */ public QueuedCruncher newCruncher( @NonNull String aaptLocation, @NonNull ILogger logger) { synchronized (sLock) { logger.info("QueuedCruncher is using %1$s", aaptLocation); if (!sInstances.containsKey(aaptLocation)) { QueuedCruncher queuedCruncher = new QueuedCruncher(aaptLocation, logger); sInstances.put(aaptLocation, queuedCruncher); } return sInstances.get(aaptLocation); } } }
@Override public void accept(PatchInfo patchInfo) { if (null != logger) { logger.info("[CreateHisPatch]" + patchInfo.getPatchVersion() + "...."); } hisPatchInfos.put(patchInfo.getPatchVersion(), patchInfo); PatchInfo newPatchInfo = null; try { newPatchInfo = createHisTPatch(patchInfo.getPatchVersion(), logger); } catch (Exception e) { throw new GradleException(e.getMessage(), e); } synchronized (buildPatchInfos) { buildPatchInfos.getPatches().add(newPatchInfo); } } });
@Override public void error(@Nullable Throwable t, @Nullable String msgFormat, Object... args) { if (msgFormat != null && shouldDowngrade(msgFormat, args)) { mDelegate.info(Strings.nullToEmpty(msgFormat), args); } else { mDelegate.error(t, msgFormat, args); } }
@Override public void warning(@NonNull String msgFormat, Object... args) { if (shouldDowngrade(msgFormat, args)) { mDelegate.info(msgFormat, args); } else { mDelegate.warning(msgFormat, args); } }
@Override public int getDensity() { String densityValue = getNullableProperty(IDevice.PROP_DEVICE_DENSITY); if (densityValue == null) { densityValue = getNullableProperty(IDevice.PROP_DEVICE_EMULATOR_DENSITY); } if (densityValue == null) { mLogger.verbose("Unable to get density for device %1$s", getName()); return -1; } try { return Integer.parseInt(densityValue); } catch (NumberFormatException e) { mLogger.info("Unable to get density for device %1$s. " + "Density value %2$s could not be parsed.", getName(), densityValue); return -1; } }