TLogger implements Log { public void error(boolean resource, String logIdOrPattern, Object... args) { if (isErrorEnabled()) { String message = createMessage(resource, logIdOrPattern, args); logger.error(message); } } protected  TLogger(Class<?> clazz); protected  TLogger(String name); static void setLocale(Locale locale); static TLogger getLogger(Class<?> clazz); static TLogger getLogger(String name); @Override boolean isFatalEnabled(); void fatal(boolean resource, String logIdOrPattern, Object... args); void fatal(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void fatal(String logId, Object... args); void fatal(String logId, Throwable throwable, Object... args); @Override boolean isErrorEnabled(); void error(boolean resource, String logIdOrPattern, Object... args); void error(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void error(String logId, Object... args); void error(String logId, Throwable throwable, Object... args); @Override boolean isWarnEnabled(); void warn(boolean resource, String logIdOrPattern, Object... args); void warn(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void warn(String logId, Object... args); void warn(String logId, Throwable throwable, Object... args); @Override boolean isInfoEnabled(); void info(boolean resource, String logIdOrPattern, Object... args); void info(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void info(String logId, Object... args); void info(String logId, Throwable throwable, Object... args); @Override boolean isDebugEnabled(); void debug(boolean resource, String logIdOrPattern, Object... args); void debug(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void debug(String logId, Object... args); void debug(String logId, Throwable throwable, Object... args); @Override boolean isTraceEnabled(); void trace(boolean resource, String logIdOrPattern, Object... args); void trace(boolean resource, String logIdOrPattern,
            Throwable throwable, Object... args); void trace(String logId, Object... args); void trace(String logId, Throwable throwable, Object... args); void log(String logId, Object... args); void log(String logId, Throwable throwable, Object... args); @Deprecated @Override void trace(Object message); @Deprecated @Override void trace(Object message, Throwable t); @Deprecated @Override void debug(Object message); @Deprecated @Override void debug(Object message, Throwable t); @Deprecated @Override void info(Object message); @Deprecated @Override void info(Object message, Throwable t); @Deprecated @Override void warn(Object message); @Deprecated @Override void warn(Object message, Throwable t); @Deprecated @Override void error(Object message); @Deprecated @Override void error(Object message, Throwable t); @Deprecated @Override void fatal(Object message); @Deprecated @Override void fatal(Object message, Throwable t); String getLogMessage(String logId, Object... args); void trace(String logId); void trace(String logId, Throwable throwable); void debug(String logId); void debug(String logId, Throwable throwable); void warn(String logId); void warn(String logId, Throwable throwable); void info(String logId); void info(String logId, Throwable throwable); void error(String logId); void error(String logId, Throwable throwable); void fatal(String logId); void fatal(String logId, Throwable throwable);  }
@Test public void testError06() throws Exception { LOGGER.error(false, "{0} is {1}", new Exception("hoge"), "a", "b"); assertEquals("[ERROR][TLoggerTest] a is b", logReader.readLine()); assertEquals("java.lang.Exception: hoge", logReader.readLine()); }
@SuppressWarnings("deprecation") @Test public void testError08() throws Exception { LOGGER.error(new StringBuilder("hoge")); assertEquals("[ERROR][TLoggerTest] hoge", logReader.readLine()); }
@SuppressWarnings("deprecation") @Test public void testError09() throws Exception { LOGGER.error(new StringBuilder("hoge"), new Exception("hoge")); assertEquals("[ERROR][TLoggerTest] hoge", logReader.readLine()); assertEquals("java.lang.Exception: hoge", logReader.readLine()); }