/** * Builds configured {@link Logger} object. * * @return the built configured {@link Logger} object */ public Logger build() { return new Logger(this); } }
/** * Initialize log system, should be called only once. * * @param logConfiguration the log configuration * @param printers the printers, each log would be printed by all of the printers * @since 1.3.0 */ public static void init(LogConfiguration logConfiguration, Printer... printers) { if (sIsInitialized) { Platform.get().warn("XLog is already initialized, do not initialize again"); } sIsInitialized = true; if (logConfiguration == null) { throw new IllegalArgumentException("Please specify a LogConfiguration"); } sLogConfiguration = logConfiguration; sPrinter = new PrinterSet(printers); sLogger = new Logger(sLogConfiguration, sPrinter); }