@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 BorderFormatter}. * * @param borderFormatter the {@link BorderFormatter} to customize * @return the {@link Logger.Builder} to build the {@link Logger} */ public static Logger.Builder borderFormatter(BorderFormatter borderFormatter) { return new Logger.Builder().borderFormatter(borderFormatter); }