/** * Initialize log system, should be called only once. * * @param logConfiguration the log configuration * @since 1.3.0 */ public static void init(LogConfiguration logConfiguration) { init(logConfiguration, DefaultsFactory.createPrinter()); }
/** * Initialize log system, should be called only once. * * @param printers the printers, each log would be printed by all of the printers * @since 1.3.0 */ public static void init(Printer... printers) { init(new LogConfiguration.Builder().build(), printers); }
/** * Initialize log system, should be called only once. * * @param logLevel the log level, logs with a lower level than which would not be printed * @param logConfiguration the log configuration * @deprecated the log level is part of log configuration now, use {@link #init(LogConfiguration)} * instead, since 1.3.0 */ @Deprecated public static void init(int logLevel, LogConfiguration logConfiguration) { init(new LogConfiguration.Builder(logConfiguration).logLevel(logLevel).build()); }
/** * Initialize log system, should be called only once. * * @param logLevel the log level, logs with a lower level than which would not be printed * @param logConfiguration the log configuration * @param printers the printers, each log would be printed by all of the printers * @deprecated the log level is part of log configuration now, * use {@link #init(LogConfiguration, Printer...)} instead, since 1.3.0 */ @Deprecated public static void init(int logLevel, LogConfiguration logConfiguration, Printer... printers) { init(new LogConfiguration.Builder(logConfiguration).logLevel(logLevel).build(), printers); }
/** * Initialize log system, should be called only once. * * @since 1.3.0 */ public static void init() { init(new LogConfiguration.Builder().build(), DefaultsFactory.createPrinter()); }
/** * Initialize log system, should be called only once. * * @param logLevel the log level, logs with a lower level than which would not be printed * @param printers the printers, each log would be printed by all of the printers */ public static void init(int logLevel, Printer... printers) { init(new LogConfiguration.Builder().logLevel(logLevel).build(), printers); }
/** * Initialize log system, should be called only once. * * @param logLevel the log level, logs with a lower level than which would not be printed */ public static void init(int logLevel) { init(new LogConfiguration.Builder().logLevel(logLevel).build(), DefaultsFactory.createPrinter()); }
@Before public void setup() { XLogUtil.beforeTest(); XLog.init(LogLevel.ALL, new AndroidPrinter() { @Override void printChunk(int logLevel, String tag, String msg) { logContainer.add(new LogItem(logLevel, tag, msg)); } }); }
@Override public void onCreate() { super.onCreate(); LogConfiguration config=new LogConfiguration.Builder() .logLevel(BuildConfig.DEBUG ? LogLevel.ALL : LogLevel.NONE) .tag("LocationPoller") .build(); Printer filePrinter= new FilePrinter.Builder(getExternalFilesDir(null).getAbsolutePath()) .fileNameGenerator(new DateFileNameGenerator()) .build(); XLog.init(config, new AndroidPrinter(), filePrinter); } }
ThreadSafePrinter printer5 = new ThreadSafePrinter(logsContainer5); XLog.init(VERBOSE, printer1, printer2, printer3, printer4, printer5);
.build(); XLog.init( // Initialize XLog
@Before public void setup() { XLogUtil.beforeTest(); XLog.init(ALL, new LogConfiguration.Builder().tag(DEFAULT_TAG).build(), new ContainerPrinter(logsContainer)); }
private void setConfig() { if (null != mExceptionHandler) { CrashHandler.getInstance(mExceptionHandler); } if (null != mPrinters && null != mLogConfiguration) { XLog.init(mLogConfiguration, mPrinters); } else if (null != mLogLevel && null != mPrinters) { XLog.init(mLogLevel, mPrinters); } else if (null != mPrinters) { XLog.init(mPrinters); } else if (null != mLogConfiguration) { XLog.init(mLogConfiguration); } else if (null != mLogLevel) { XLog.init(mLogLevel); } else { XLog.init(); } }
private void setConfig() { if (!TextUtils.isEmpty(mRootDirectoryName)) { SDCardUtil.setRootDirName(mRootDirectoryName); } SDCardUtil.initDir(); if (null != mExceptionHandler) { CrashHandler.getInstance(mExceptionHandler); } if (null != mPrinters && null != mLogConfiguration) { XLog.init(mLogConfiguration, mPrinters); } else if (null != mLogLevel && null != mPrinters) { XLog.init(mLogLevel, mPrinters); } else if (null != mPrinters) { XLog.init(mPrinters); } else if (null != mLogConfiguration) { XLog.init(mLogConfiguration); } else if (null != mLogLevel) { XLog.init(mLogLevel); } else { XLog.init(); } }
@Override public void onCreate() { super.onCreate(); PhotoUtil.init(getApplicationContext(),new FrescoIniter()); //Logger.initialize(new Settings()); XLog.init(LogLevel.ALL); } }