private static ILogger createLogger(@NonNull StdLogger.Level level) { return new StdLogger(level); } }
/** * <p> * Prints an info message. * </p> * <p> * The output is done on {@link System#out}. * </p> * <p> * This is displayed only if the logging {@link Level} is {@link Level#INFO} or higher. * * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null. * @param args provides the arguments for msgFormat. */ @Override public void info(@NonNull String msgFormat, Object... args) { if (mLevel.mLevel > Level.INFO.mLevel) { return; } String msg = String.format(msgFormat, args); printMessage(msg, System.out); }
/** * <p> * Prints a verbose message. * </p> * <p> * The output is done on {@link System#out}. * </p> * <p> * This is displayed only if the logging {@link Level} is {@link Level#VERBOSE} or higher. * </p> * @param msgFormat is a string format to be used with a {@link Formatter}. Cannot be null. * @param args provides the arguments for msgFormat. */ @Override public void verbose(@NonNull String msgFormat, Object... args) { if (mLevel.mLevel > Level.VERBOSE.mLevel) { return; } String msg = String.format(msgFormat, args); printMessage(msg, System.out); }
String mainManifest = null; StdLogger.Level logLevel = StdLogger.Level.ERROR; ILogger logger = new StdLogger(logLevel); while (arguments.hasNext()) { String selector = arguments.next();
/** * <p> * Prints a warning message. * </p> * <p> * The message will be tagged with "Warning" on the output so the caller does not * need to put such a prefix in the format string. * </p> * <p> * The output is done on {@link System#out}. * </p> * <p> * This is displayed only if the logging {@link Level} is {@link Level#WARNING} or higher. * * @param warningFormat is a string format to be used with a {@link Formatter}. Cannot be null. * @param args provides the arguments for warningFormat. */ @Override public void warning(@NonNull String warningFormat, Object... args) { if (mLevel.mLevel > Level.WARNING.mLevel) { return; } String msg = String.format("Warning: " + warningFormat, args); printMessage(msg, System.out); }
private static ProgressIndicator getNewDownloadProgress() { return new LoggerProgressIndicatorWrapper(new StdLogger(StdLogger.Level.VERBOSE)); } }
/** * <p> * Prints an error message. * </p> * <p> * The message will be tagged with "Error" on the output so the caller does not * need to put such a prefix in the format string. * </p> * <p> * The output is done on {@link System#err}. * </p> * This is always displayed, independent of the logging {@link Level}. * * @param t is an optional {@link Throwable} or {@link Exception}. If non-null, it's * message will be printed out. * @param errorFormat is an optional error format. If non-null, it will be printed * using a {@link Formatter} with the provided arguments. * @param args provides the arguments for errorFormat. */ @Override public void error(@Nullable Throwable t, @Nullable String errorFormat, Object... args) { if (errorFormat != null) { String msg = String.format("Error: " + errorFormat, args); printMessage(msg, System.err); } if (t != null) { System.err.println(String.format("Error: %1$s", t.getMessage())); } }
synchronized ProcessRecorder get() { if (processRecorder == null) { if (recordWriter == null) { throw new RuntimeException("recordWriter not configured."); } if (iLogger == null) { iLogger = new StdLogger(StdLogger.Level.INFO); } processRecorder = new ProcessRecorder(recordWriter, iLogger); } return processRecorder; }
synchronized ProcessProfileWriter get() { if (processProfileWriter == null) { Preconditions.checkState( profileOutputFile != null, "call setProfileOutputFile() first"); if (mLogger == null) { mLogger = new StdLogger(StdLogger.Level.INFO); } initializeAnalytics(mLogger, mScheduledExecutorService); processProfileWriter = new ProcessProfileWriter(profileOutputFile); } return processProfileWriter; } }
@VisibleForTesting protected ILogger createLogger(@NonNull StdLogger.Level level) { return new StdLogger(level); }
@VisibleForTesting public static void initializeForTests(@NonNull Path profileOutputFile) { sINSTANCE = new ProcessProfileWriterFactory(); sINSTANCE.setProfileOutputFile(profileOutputFile); ProcessProfileWriter recorder = sINSTANCE.get(); // Initialize the ProcessProfileWriter instance recorder.resetForTests(); setGlobalProperties(recorder, new File("fake/path/to/test_project/"), "2.10", new StdLogger(StdLogger.Level.VERBOSE)); }
ILogger logger = new StdLogger(logLevel); while (arguments.hasNext()) { String selector = arguments.next();
ILogger logger = new StdLogger(StdLogger.Level.INFO); ResourceMerger merger = new ResourceMerger(0);
ILogger logger = new StdLogger(StdLogger.Level.INFO); ResourceMerger merger = new ResourceMerger(0);
public File installSdkTool(@NonNull SdkLibData sdkLibData, @NonNull String packageId) { ProgressIndicator progress = new LoggerProgressIndicatorWrapper(new StdLogger(StdLogger.Level.WARNING)); RepoManager repoManager = mSdkHandler.getSdkManager(progress); repoManager.loadSynchronously(0, progress, null, null);