All Implemented Interfaces:
org.junit.jupiter.api.extension.AfterAllCallback, org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.Extension
public class LogLevelExtension
extends Object
implements org.junit.jupiter.api.extension.BeforeAllCallback, org.junit.jupiter.api.extension.AfterAllCallback
A extension that sets the log level for specific class/package loggers for a test. Logging
configuration will only be extended when logging is enabled at all (so root logger is not OFF).
Constructor Summary
Constructors
Method Summary
All Methods Instance Methods Concrete Methods
void
afterAll (org.junit.jupiter.api.extension.ExtensionContext context)
void
beforeAll (org.junit.jupiter.api.extension.ExtensionContext context)
set (Class <?> clazz,
org.slf4j.event.Level level)
set (Package logPackage,
org.slf4j.event.Level level)
set (String classOrPackageName,
org.slf4j.event.Level level)
Methods inherited from class java.lang.Object
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
Field Details
LOGGING_ENABLED
public static final boolean LOGGING_ENABLED
Constructor Details
LogLevelExtension
public LogLevelExtension ()
Method Details
beforeAll
public void beforeAll (org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
Specified by:
beforeAll in interface org.junit.jupiter.api.extension.BeforeAllCallback
Throws:
Exception
afterAll
public void afterAll (org.junit.jupiter.api.extension.ExtensionContext context)
throws Exception
Specified by:
afterAll in interface org.junit.jupiter.api.extension.AfterAllCallback
Throws:
Exception