Package org.apache.log4j.helpers
Class UtilLoggingLevel
- java.lang.Object
-
- org.apache.log4j.Priority
-
- org.apache.log4j.Level
-
- org.apache.log4j.helpers.UtilLoggingLevel
-
- All Implemented Interfaces:
Serializable
public class UtilLoggingLevel extends org.apache.log4j.Level
An extension of the Level class that provides support for java.util.logging Levels.- Author:
- Scott Deboy (sdeboy@apache.org)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static UtilLoggingLevel
CONFIG
CONFIG.static int
CONFIG_INT
Numerical value for CONFIG.static UtilLoggingLevel
FINE
FINE.static int
FINE_INT
Numerical value for FINE.static UtilLoggingLevel
FINER
FINER.static int
FINER_INT
Numerical value for FINER.static UtilLoggingLevel
FINEST
FINEST.static int
FINEST_INT
Numerical value for FINEST.static UtilLoggingLevel
INFO
INFO.static UtilLoggingLevel
SEVERE
SEVERE.static int
SEVERE_INT
Numerical value for SEVERE.static int
UNKNOWN_INT
Numerical value for UNKNOWN.static UtilLoggingLevel
WARNING
WARNING.static int
WARNING_INT
Numerical value for WARNING.
-
Constructor Summary
Constructors Modifier Constructor Description protected
UtilLoggingLevel(int level, String levelStr, int syslogEquivalent)
Create new instance.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<UtilLoggingLevel>
getAllPossibleLevels()
Gets list of supported levels.static org.apache.log4j.Level
toLevel(int val)
Gets level matching numeric value.static UtilLoggingLevel
toLevel(int val, UtilLoggingLevel defaultLevel)
Convert an integer passed as argument to a level.static org.apache.log4j.Level
toLevel(String s)
Get level with specified symbolic name.static org.apache.log4j.Level
toLevel(String sArg, org.apache.log4j.Level defaultLevel)
Get level with specified symbolic name.
-
-
-
Field Detail
-
SEVERE_INT
public static final int SEVERE_INT
Numerical value for SEVERE.- See Also:
- Constant Field Values
-
WARNING_INT
public static final int WARNING_INT
Numerical value for WARNING.- See Also:
- Constant Field Values
-
CONFIG_INT
public static final int CONFIG_INT
Numerical value for CONFIG.- See Also:
- Constant Field Values
-
FINE_INT
public static final int FINE_INT
Numerical value for FINE.- See Also:
- Constant Field Values
-
FINER_INT
public static final int FINER_INT
Numerical value for FINER.- See Also:
- Constant Field Values
-
FINEST_INT
public static final int FINEST_INT
Numerical value for FINEST.- See Also:
- Constant Field Values
-
UNKNOWN_INT
public static final int UNKNOWN_INT
Numerical value for UNKNOWN.- See Also:
- Constant Field Values
-
SEVERE
public static final UtilLoggingLevel SEVERE
SEVERE.
-
WARNING
public static final UtilLoggingLevel WARNING
WARNING.
-
INFO
public static final UtilLoggingLevel INFO
INFO.
-
CONFIG
public static final UtilLoggingLevel CONFIG
CONFIG.
-
FINE
public static final UtilLoggingLevel FINE
FINE.
-
FINER
public static final UtilLoggingLevel FINER
FINER.
-
FINEST
public static final UtilLoggingLevel FINEST
FINEST.
-
-
Constructor Detail
-
UtilLoggingLevel
protected UtilLoggingLevel(int level, String levelStr, int syslogEquivalent)
Create new instance.- Parameters:
level
- numeric value for level.levelStr
- symbolic name for level.syslogEquivalent
- Equivalent syslog severity.
-
-
Method Detail
-
toLevel
public static UtilLoggingLevel toLevel(int val, UtilLoggingLevel defaultLevel)
Convert an integer passed as argument to a level. If the conversion fails, then this method returns the specified default.- Parameters:
val
- numeric value.defaultLevel
- level to be returned if no level matches numeric value.- Returns:
- matching level or default level.
-
toLevel
public static org.apache.log4j.Level toLevel(int val)
Gets level matching numeric value.- Parameters:
val
- numeric value.- Returns:
- matching level or UtilLoggerLevel.FINEST if no match.
-
getAllPossibleLevels
public static List<UtilLoggingLevel> getAllPossibleLevels()
Gets list of supported levels.- Returns:
- list of supported levels.
-
toLevel
public static org.apache.log4j.Level toLevel(String s)
Get level with specified symbolic name.- Parameters:
s
- symbolic name.- Returns:
- matching level or Level.DEBUG if no match.
-
toLevel
public static org.apache.log4j.Level toLevel(String sArg, org.apache.log4j.Level defaultLevel)
Get level with specified symbolic name.- Parameters:
sArg
- symbolic name.defaultLevel
- level to return if no match.- Returns:
- matching level or defaultLevel if no match.
-
-