Logger { public boolean isLoggable(Level level) { return level.isGreaterOrEquals(loggerContext.getCurrentLevel()); } Logger(LoggerContext loggerContext, String name); void trace(String message, Object... args); void debug(String message, Object... args); void info(String message, Object... args); void warn(String message, Object... args); void warn(Element element, String message, Object... args); void warn(Element element, AnnotationMirror annotationMirror, String message); void error(String message, Object... args); void error(Element element, String message, Object... args); void error(Throwable thr, String message, Object... args); void error(Element element, Throwable thr, String message, Object... args); void error(Element element, AnnotationMirror annotationMirror, String message); boolean isLoggable(Level level);  }
@Test public void testIsLoggable() throws Exception { LoggerContext loggerContext = LoggerContext.getInstance(); loggerContext.setCurrentLevel(Level.INFO); Logger logger = new Logger(loggerContext, getClass().getName()); Assert.assertFalse(logger.isLoggable(Level.DEBUG)); Assert.assertTrue(logger.isLoggable(Level.INFO)); Assert.assertTrue(logger.isLoggable(Level.WARN)); }