Enum Class TestLogLevel

java.lang.Object
java.lang.Enum<TestLogLevel>
de.cuioss.test.juli.TestLogLevel
All Implemented Interfaces:
Serializable, Comparable<TestLogLevel>, Constable

public enum TestLogLevel extends Enum<TestLogLevel>
Defines the log-levels with implicit mapping to JUL log level according to: SLF4JBridgeHandler
Author:
Oliver Wolff
  • Enum Constant Details

  • Method Details

    • values

      public static TestLogLevel[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TestLogLevel valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • setAsRootLevel

      Convenient method for setting the root-logger-level in the context of the current TestLogLevel
      Returns:
      the TestLogLevel itself in order to us is in a fluent way
    • addLogger

      public TestLogLevel addLogger(Class<?> className)
      Convenient method for setting a Log-Level in the context of the current TestLogLevel
      Parameters:
      className - if it is null it will set the root-logger for the actual Log-Level
      Returns:
      the TestLogLevel itself in order to us is in a fluent way
    • addLogger

      public TestLogLevel addLogger(String loggerName)
      Convenient method for setting a Log-Level in context of the current TestLogLevel
      Parameters:
      loggerName - if it is null or empty it will set the root-logger for the actual Log-Level
      Returns:
      the TestLogLevel itself in order to us is in a fluent way
    • parse

      public static TestLogLevel parse(Level level)
      Parameters:
      level - to be parsed, must not be null
      Returns:
      the mapped level or INFO if the level can not be mapped