public class LogFixture extends Object implements AutoCloseable
Typical usage:
@Test
public void myTest() {
LogFixtureBuilder logBuilder = LogFixture.builder()
.toConsole()
.disable() // Silence all other loggers
.logger(ExternalSortBatch.class, Level.DEBUG);
try (LogFixture logs = logBuilder.build()) {
// Test code here
}
}
You can – and should – combine the log fixture with the cluster and client fixtures to have complete control over your test-time Drill environment.
| Modifier and Type | Class and Description |
|---|---|
static class |
LogFixture.LogFixtureBuilder
Builds the log settings to be used for a test.
|
static class |
LogFixture.LogSpec
Memento for a logger name and level.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONSOLE_FORMAT |
| Constructor and Description |
|---|
LogFixture(LogFixture.LogFixtureBuilder builder) |
| Modifier and Type | Method and Description |
|---|---|
static LogFixture.LogFixtureBuilder |
builder()
Creates a new log fixture builder.
|
void |
close() |
public static final String DEFAULT_CONSOLE_FORMAT
public LogFixture(LogFixture.LogFixtureBuilder builder)
public static LogFixture.LogFixtureBuilder builder()
public void close()
close in interface AutoCloseableCopyright © 2021 The Apache Software Foundation. All rights reserved.