Package de.cuioss.test.juli
Enum TestLogLevel
- java.lang.Object
-
- java.lang.Enum<TestLogLevel>
-
- de.cuioss.test.juli.TestLogLevel
-
- All Implemented Interfaces:
Serializable,Comparable<TestLogLevel>
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 Summary
Enum Constants Enum Constant Description DEBUGDebug Level, maps toLevel.FINE.ERRORError Level, maps toLevel.SEVERE.INFOInfo Level, maps toLevel.INFO.TRACETrace Level, maps toLevel.FINER.WARNWarn Level, maps toLevel.WARNING.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description TestLogLeveladdLogger(Class<?> className)Convenient method for setting a Log-Level in the context of the currentTestLogLevelTestLogLeveladdLogger(String loggerName)Convenient method for setting a Log-Level in context of the currentTestLogLevelLevelgetJuliLevel()static TestLogLevelparse(Level level)TestLogLevelsetAsRootLevel()Convenient method for setting the root-logger-level in the context of the currentTestLogLevelstatic TestLogLevelvalueOf(String name)Returns the enum constant of this type with the specified name.static TestLogLevel[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TRACE
public static final TestLogLevel TRACE
Trace Level, maps toLevel.FINER.
-
DEBUG
public static final TestLogLevel DEBUG
Debug Level, maps toLevel.FINE.
-
INFO
public static final TestLogLevel INFO
Info Level, maps toLevel.INFO.
-
WARN
public static final TestLogLevel WARN
Warn Level, maps toLevel.WARNING.
-
ERROR
public static final TestLogLevel ERROR
Error Level, maps toLevel.SEVERE.
-
-
Method Detail
-
values
public static TestLogLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TestLogLevel c : TestLogLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TestLogLevel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
setAsRootLevel
public TestLogLevel setAsRootLevel()
Convenient method for setting the root-logger-level in the context of the currentTestLogLevel- Returns:
- the
TestLogLevelitself 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 currentTestLogLevel- Parameters:
className- if it isnullit will set the root-logger for the actual Log-Level- Returns:
- the
TestLogLevelitself 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 currentTestLogLevel- Parameters:
loggerName- if it isnullor empty it will set the root-logger for the actual Log-Level- Returns:
- the
TestLogLevelitself 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
INFOif the level can not be mapped
-
getJuliLevel
public Level getJuliLevel()
-
-