@Override public void receiveMessage( Message message ) { logger.info( message .toString() ); // TBD anything else to do? }
private static ILogger createLogger(@NonNull StdLogger.Level level) { return new StdLogger(level); } }
String mainManifest = null; StdLogger.Level logLevel = StdLogger.Level.ERROR; ILogger logger = new StdLogger(logLevel); while (arguments.hasNext()) { String selector = arguments.next(); if (!selector.startsWith("--")) { logger.error( null /* throwable */, "Invalid parameter " + selector + ", expected a command switch"); return 1; logger.error( null /* throwable */, "Command switch " + selector + " has no value associated"); return 1; logLevel = StdLogger.Level.valueOf(value); String value = arguments.next(); if (Strings.isNullOrEmpty(value)) { logger.error(null /* throwable */, "Empty value for switch " + selector); return 1; logger.error( null /* throwable */, "Invalid property setting, should be NAME=VALUE format"); return 1; invoker.setOverride(manifestSystemProperty, value.substring(value.indexOf('=') + 1)); } catch (IllegalArgumentException e) { logger.error( e,
FileUtils.copyFile(inputJar.getFile(), outputJar); new File(outputDir, FileUtils.relativePossiblyNonExistingPath(inputFile, inputDir)); FileUtils.delete(outputFile); break; FileUtils.copyFile(inputFile, outputFile); FileUtils.deleteDirectoryContents(inputDir); inputDir.mkdirs(); Iterable<File> files = FileUtils.getAllFiles(inputDir); for (File inputFile : files) { File outputFile = new File(outputDir, FileUtils.relativePath(inputFile, inputDir)); FileUtils.copyFile(inputFile, outputFile);
/** * Prints a line to stderr. * 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 stderr(String format, Object...args) { mLog.error(null, format, args); }
private void verbose(String format, Object...args) { if (VERBOSE) { mLogger.verbose(format, args); } } }
private File getTestDataRootDir() { CodeSource source = getClass().getProtectionDomain().getCodeSource(); if (source != null) { URL location = source.getLocation(); try { File classesDir = SdkUtils.urlToFile(location); return classesDir.getParentFile().getAbsoluteFile().getParentFile().getParentFile(); } catch (MalformedURLException e) { fail(e.getLocalizedMessage()); } } return null; }
public HtmlBuilder addUnderlined(String text) { beginUnderline(); add(text); endUnderline(); return this; }
/** * Given an index in the range <code>0...size()-1</code>, sets a new * value for the <code>index</code>th key-value mapping that this * SparseArray stores. */ public void setValueAt(int index, E value) { if (mGarbage) { gc(); } mValues[index] = value; }
/** * Alias for {@link #delete(int)}. */ public void remove(int key) { delete(key); }
/** * Constructs a new pair of the given two objects, inferring generic types. * * @param first the first item to store in the pair * @param second the second item to store in the pair * @param <S> the type of the first item * @param <T> the type of the second item * @return a new pair wrapping the two items */ public static <S,T> Pair<S,T> of(S first, T second) { return new Pair<S,T>(first,second); }
/** * Gets the int mapped from the specified key, or the specified value * if no such mapping has been made. */ public int get(int key, int valueIfKeyNotFound) { int i = binarySearch(mKeys, 0, mSize, key); if (i < 0) { return valueIfKeyNotFound; } else { return mValues[i]; } }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + mLayoutlibVersion.hashCode(); return result; }
@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 ); }
@Override public void processNewLines(String[] lines) { for (String line : lines) { logger.verbose(line); } }
/** * Returns the number of key-value mappings that this SparseArray * currently stores. */ public int size() { if (mGarbage) { gc(); } return mSize; }
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.verbose(line); } }
@Override public void processNewLines(String[] lines) { for (String line : lines) { logger.info(line); } }