SystemLogger extends Logger { public void debug(Throwable t, final Object ... args) { if(!level.shouldLog(Level.DEBUG)) { return; } System.out.println("[DEBUG] " + name + ": " + getString(args) + ": " + t.getMessage()); t.printStackTrace(); } SystemLogger(final String name); boolean isDebugEnabled(); void debug(Throwable t, final Object ... args); void debug(final Object ... args); void info(Throwable t, final Object ... args); void info(final Object ... args); void warn(Throwable t, final Object ... args); void warn(final Object ... args); void error(Throwable t, final Object ... args); void error(final Object ... args); static final String PROPERTY_LOG_LEVEL; }
@Test public void testDebug() throws Exception { System.setProperty(SystemLogger.PROPERTY_LOG_LEVEL, "debug"); SystemLogger logger = new SystemLogger("testlogger.debug"); logger.debug("debug"); logger.warn("warn"); }