| 1 | package org.lttng.ust.agent.benchmarks.jul.handler; |
| 2 | |
| 3 | import java.io.IOException; |
| 4 | import java.nio.file.Files; |
| 5 | import java.nio.file.Path; |
| 6 | import java.util.logging.FileHandler; |
| 7 | import java.util.logging.SimpleFormatter; |
| 8 | |
| 9 | import org.junit.After; |
| 10 | import org.junit.Before; |
| 11 | |
| 12 | public class FileHandlerBenchmark extends AbstractJulBenchmark { |
| 13 | |
| 14 | private Path outputFile; |
| 15 | |
| 16 | @Before |
| 17 | public void testSetup() throws SecurityException, IOException { |
| 18 | outputFile = Files.createTempFile(this.getClass().getSimpleName(), null); |
| 19 | |
| 20 | handler = new FileHandler(outputFile.toString(), false); |
| 21 | handler.setFormatter(new SimpleFormatter()); |
| 22 | } |
| 23 | |
| 24 | @After |
| 25 | public void testTeardown() throws IOException { |
| 26 | Files.deleteIfExists(outputFile); |
| 27 | } |
| 28 | } |