Annotation Type DisableLogging
-
@ExtendWith(com.github.robtimus.junit.support.extension.logging.DisableLoggingExtension.class) @Target({FIELD,ANNOTATION_TYPE}) @Retention(RUNTIME) public @interface DisableLogging
DisableLoggingcan be used to disable logging for the duration of a test.To disable logging, add a logger field (static or not) to your test class and annotate it with
DisableLogging. The following types of loggers are supported:Logger, usually created usingLogManager.getLogger(String).Logger(from Log4j 2), usually created usingLogManager.getLogger(String)orLogManager.getLogger(Class). Note that this requireslog4j-coreas implementation.Logger(from reload4j or Log4j 1.x), usually created usingLogger.getLogger(String)orLogger.getLogger(Class).Logger(from logback), usually created usingLoggerFactory.getLogger(String)orLoggerFactory.getLogger(Class). Note that this requireslogbackas single SLF4J implementation.
- Author:
- Rob Spoor
- Since:
- 3.0