Class LogLevelExtension

  • 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).
    • Field Detail

      • LOGGING_ENABLED

        public static final boolean LOGGING_ENABLED
    • Constructor Detail

      • LogLevelExtension

        public LogLevelExtension()
    • Method Detail

      • 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