Annotation Type LogLevels


  • @ExtendWith(LogLevelsCondition.class)
    @Target({TYPE,METHOD})
    @Retention(RUNTIME)
    @Documented
    public @interface LogLevels
    Test classes annotated with this will change logging levels between tests. It can also be applied to individual test methods. If both class-level and method-level annotations are present, the method-level annotation is used.
    Since:
    2.2
    Author:
    Gary Russell
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      java.lang.String[] categories
      Category names representing Log4j or Logback categories to change.
      java.lang.Class<?>[] classes
      Classes representing Log4j categories to change.
      java.lang.String level
      The Log4j level name to switch the categories to during the test.
    • Element Detail

      • classes

        java.lang.Class<?>[] classes
        Classes representing Log4j categories to change.
        Returns:
        the classes.
        Default:
        {}
      • categories

        java.lang.String[] categories
        Category names representing Log4j or Logback categories to change.
        Returns:
        the names.
        Default:
        {}
      • level

        java.lang.String level
        The Log4j level name to switch the categories to during the test.
        Returns:
        the level (default Log4j Levels.toLevel() - currently, DEBUG).
        Default:
        ""