@Test public void testCustomBorderFormatter() { XLog.t().threadFormatter(new ThreadFormatter() { @Override public String format(Thread data) { return "T1"; } }).b().borderFormatter(new BorderFormatter() { @Override public String format(String[] segments) { return addCustomBorder(segments); } }).i(MESSAGE); assertLog(INFO, DEFAULT_TAG, addCustomBorder(new String[]{"T1", MESSAGE})); }
/** * Start to customize a {@link Logger} and set the {@link ThreadFormatter}. * * @param threadFormatter the {@link ThreadFormatter} to customize * @return the {@link Logger.Builder} to build the {@link Logger} */ public static Logger.Builder threadFormatter(ThreadFormatter threadFormatter) { return new Logger.Builder().threadFormatter(threadFormatter); }