Example usage for java.util.logging Logger config

List of usage examples for java.util.logging Logger config

Introduction

In this page you can find the example usage for java.util.logging Logger config.

Prototype

ConfigurationData config

To view the source code for java.util.logging Logger config.

Click Source Link

Usage

From source file:org.usrz.libs.logging.LevelWarningTest.java

@Test
public void testJavaLogging() {
    final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(this.getClass().getName());

    logger.finest("Foobar FINEST");
    AppenderForTests.hasNoLastEvent("at Finest level");
    assertFalse(logger.isLoggable(java.util.logging.Level.FINEST));

    logger.finer("Foobar FINER");
    AppenderForTests.hasNoLastEvent("at Finer level");
    assertFalse(logger.isLoggable(java.util.logging.Level.FINER));

    logger.fine("Foobar FINE");
    AppenderForTests.hasNoLastEvent("at Fine level");
    assertFalse(logger.isLoggable(java.util.logging.Level.FINE));

    logger.config("Foobar CONFIG");
    AppenderForTests.hasNoLastEvent("at Config level");
    assertFalse(logger.isLoggable(java.util.logging.Level.CONFIG));

    logger.info("Foobar INFO");
    AppenderForTests.hasNoLastEvent("at Info level");
    assertFalse(logger.isLoggable(java.util.logging.Level.INFO));

    logger.warning("Foobar WARNING");
    AppenderForTests.hasLastEvent("at Warning level");
    assertTrue(logger.isLoggable(java.util.logging.Level.WARNING));

    logger.severe("Foobar SEVERE");
    AppenderForTests.hasLastEvent("at Severe level");
    assertTrue(logger.isLoggable(java.util.logging.Level.SEVERE));

}