Search in sources :

Example 6 with MemoryHandler

use of java.util.logging.MemoryHandler in project j2objc by google.

the class MemoryHandlerTest method testMemoryHandlerDefaultValue.

public void testMemoryHandlerDefaultValue() throws SecurityException, IOException {
    props.clear();
    props.put("java.util.logging.MemoryHandler.target", baseClassName + "$MockHandler");
    manager.readConfiguration(EnvironmentHelper.PropertiesToInputStream(props));
    handler = new MemoryHandler();
    assertNull(handler.getFilter());
    assertTrue(handler.getFormatter() instanceof SimpleFormatter);
    assertNull(handler.getEncoding());
    assertNotNull(handler.getErrorManager());
    assertEquals(handler.getLevel(), Level.ALL);
    assertEquals(handler.getPushLevel(), Level.SEVERE);
}
Also used : SimpleFormatter(java.util.logging.SimpleFormatter) MemoryHandler(java.util.logging.MemoryHandler)

Example 7 with MemoryHandler

use of java.util.logging.MemoryHandler in project logging-log4j2 by apache.

the class MemoryHandlerJULLocationBenchmark method up.

@Setup(Level.Trial)
public void up() {
    memoryHandler = new MemoryHandler(new NoOpJULHandler(), 262144, java.util.logging.Level.SEVERE);
    logger = Logger.getLogger(getClass().getName());
    logger.setUseParentHandlers(false);
    logger.addHandler(memoryHandler);
    logger.setLevel(java.util.logging.Level.ALL);
}
Also used : MemoryHandler(java.util.logging.MemoryHandler) NoOpJULHandler(org.apache.logging.log4j.perf.util.NoOpJULHandler) Setup(org.openjdk.jmh.annotations.Setup)

Example 8 with MemoryHandler

use of java.util.logging.MemoryHandler in project logging-log4j2 by apache.

the class MemoryHandlerJULBenchmark method up.

@Setup(Level.Trial)
public void up() {
    memoryHandler = new MemoryHandler(new NoOpJULHandler(), 262144, java.util.logging.Level.SEVERE);
    logger = java.util.logging.Logger.getLogger(getClass().getName());
    logger.setUseParentHandlers(false);
    logger.addHandler(memoryHandler);
    logger.setLevel(java.util.logging.Level.ALL);
}
Also used : MemoryHandler(java.util.logging.MemoryHandler) NoOpJULHandler(org.apache.logging.log4j.perf.util.NoOpJULHandler) Setup(org.openjdk.jmh.annotations.Setup)

Aggregations

MemoryHandler (java.util.logging.MemoryHandler)8 SimpleFormatter (java.util.logging.SimpleFormatter)2 NoOpJULHandler (org.apache.logging.log4j.perf.util.NoOpJULHandler)2 Setup (org.openjdk.jmh.annotations.Setup)2 File (java.io.File)1 PrintStream (java.io.PrintStream)1 LogRecord (java.util.logging.LogRecord)1 NullOutputStream (org.apache.harmony.logging.tests.java.util.logging.HandlerTest.NullOutputStream)1