@Test public void testErrorShortCircuit() { inner.setLevel(Level.OFF); logger.error("hello"); assertTrue(handler.isEmpty()); }
public void error(Throwable exception, String format, Object... args) { if (logger.isLoggable(SEVERE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor(Level.ERROR, format, args), e); message = rawMessageFor(format, args); } logger.log(SEVERE, message, exception); } }
Logger { public void error(Throwable exception, String format, Object... args) { if (logger.isLoggable(SEVERE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor(Level.ERROR, format, args), e); message = rawMessageFor(format, args); } logger.log(SEVERE, message, exception); } } }
Logger { public void error(Throwable exception, String format, Object... args) { if (logger.isLoggable(SEVERE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor(Level.ERROR, format, args), e); message = rawMessageFor(format, args); } logger.log(SEVERE, message, exception); } } Logger(java.util.logging.Logger logger); }
Logger { public void error(Throwable exception, String format, Object... args) { if (logger.isLoggable(SEVERE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor(Level.ERROR, format, args), e); message = rawMessageFor(format, args); } logger.log(SEVERE, message, exception); } } Logger(java.util.logging.Logger logger); static Logger get(Class<?> clazz); static Logger get(String name); void trace(String format, Object... args); void debug(String format, Object... args); void debug(Throwable exception, String format, Object... args); void info(String format, Object... args); void warn(Throwable exception, String format, Object... args); void warn(String format, Object... args); void error(Throwable exception, String format, Object... args); void error(Throwable exception); void error(String format, Object... args); boolean isDebugEnabled(); boolean isInfoEnabled(); }
Logger { public void error(Throwable exception, String format, Object... args) { if (logger.isLoggable(SEVERE)) { String message; try { message = format(format, args); } catch (IllegalFormatException e) { logger.log(SEVERE, illegalFormatMessageFor(Level.ERROR, format, args), e); message = rawMessageFor(format, args); } logger.log(SEVERE, message, exception); } } Logger(java.util.logging.Logger logger); static Logger get(Class<?> clazz); static Logger get(String name); void trace(String format, Object... args); void debug(String format, Object... args); void debug(Throwable exception, String format, Object... args); void info(String format, Object... args); void warn(Throwable exception, String format, Object... args); void warn(String format, Object... args); void error(Throwable exception, String format, Object... args); void error(Throwable exception); void error(String format, Object... args); boolean isDebugEnabled(); boolean isInfoEnabled();  }