本文整理了Java中com.elvishew.xlog.XLog.init()
方法的一些代码示例,展示了XLog.init()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XLog.init()
方法的具体详情如下:
包路径:com.elvishew.xlog.XLog
类名称:XLog
方法名:init
[英]Initialize log system, should be called only once.
[中]初始化日志系统,只应调用一次。
代码示例来源:origin: elvishew/xLog
/**
* 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());
}
代码示例来源:origin: elvishew/xLog
/**
* 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);
}
代码示例来源:origin: elvishew/xLog
/**
* 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());
}
代码示例来源:origin: elvishew/xLog
/**
* 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);
}
代码示例来源:origin: elvishew/xLog
/**
* Initialize log system, should be called only once.
*
* @since 1.3.0
*/
public static void init() {
init(new LogConfiguration.Builder().build(), DefaultsFactory.createPrinter());
}
代码示例来源:origin: elvishew/xLog
/**
* 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);
}
代码示例来源:origin: elvishew/xLog
/**
* 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());
}
代码示例来源:origin: elvishew/xLog
@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));
}
});
}
代码示例来源:origin: commonsguy/cw-omnibus
@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);
}
}
代码示例来源:origin: elvishew/xLog
ThreadSafePrinter printer5 = new ThreadSafePrinter(logsContainer5);
XLog.init(VERBOSE, printer1, printer2, printer3, printer4, printer5);
代码示例来源:origin: elvishew/xLog
.build();
XLog.init( // Initialize XLog
代码示例来源:origin: elvishew/xLog
@Before
public void setup() {
XLogUtil.beforeTest();
XLog.init(ALL,
new LogConfiguration.Builder().tag(DEFAULT_TAG).build(),
new ContainerPrinter(logsContainer));
}
代码示例来源:origin: qyxxjd/BaseProject
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();
}
}
代码示例来源:origin: qyxxjd/BaseProject
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();
}
}
代码示例来源:origin: hss01248/PhotoOut
@Override
public void onCreate() {
super.onCreate();
PhotoUtil.init(getApplicationContext(),new FrescoIniter());
//Logger.initialize(new Settings());
XLog.init(LogLevel.ALL);
}
}
内容来源于网络,如有侵权,请联系作者删除!