com.ibm.etools.logging.util
Class Level

java.lang.Object
  |
  +--com.ibm.etools.logging.util.Level

public final class Level
extends java.lang.Object

Licensed Material - Property of IBM (C) Copyright IBM Corp. 2003, 2005 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Static constants and convenience methods representing accumulating levels of logging from no information (0) to all logged information (7). The higher the level, the more verbose and quantity of logging information.

The logging level is that level at which messages with a certain degree of detail and less will be recorded in the log file. That is, the higher the logging level, the lesser the amount of information logged. Only messages with the same or higher logging level than the logging level that is selected will be logged.
Note: When the level that is selected is NONE, no messages are logged.
The order of logging levels is as follows:
1. ALL (lowest level: all information logged)
2. FINEST
3. FINER
4. FINE
5. CONFIG
6. INFO
7. WARNING
8. SEVERE (highest level: least information logged)
9. NONE (no logging)
For example, if you select WARNING, onnly WARNING and SEVERE messages will be included, ant other messages will not.

CHANGE HISTORY Date Programmer Defect Description -------- ----------------- ------- -------------------------------- 14/09/01 paules@ca.ibm.com f184021 Initial creation. 27/09/01 paules@ca.ibm.com 185401 Added isValidLevel() method. 04/10/01 paules@ca.ibm.com 185401 Added String[] LEVELNAMES array and getLevelName(), getLevelNames() and getLevel() methods. 04/07/03 amehrega@ca.ibm.com 249737 Add an 'ALL' level to Level.java 20/10/03 allencw@ca.ibm.com 262936 Update class comment header for Level.java.


Field Summary
static int ALL
           
static int CONFIG
           
static int FINE
           
static int FINER
           
static int FINEST
           
static int INFO
           
static int NONE
           
static int SEVERE
           
static int WARNING
           
 
Constructor Summary
Level()
           
 
Method Summary
static int getLevel(java.lang.String levelName)
          Returns the integer level value for the parameter level String.
static java.lang.String getLevelName(int level)
          Returns the String representation for the parameter logging level.
static java.lang.String[] getLevelNames()
          Returns the array of the String representations of the eight logging levels.
static java.lang.String getTranslatedLevelName(int level)
          Returns the translated String representation for the parameter logging level.
static java.lang.String getTranslatedLevelName(java.lang.String levelName)
          Returns the translated String representation for the parameter logging level String.
static java.lang.String[] getTranslatedLevelNames()
          Returns the array of the String representations of the eight translated logging levels.
static boolean isValidLevel(int checkLevel)
          Checks if the parameter check level is one of the eight valid logging levels.
static boolean isValidLevel(java.lang.String checkLevel)
          Checks if the parameter check level name is one of the eight valid logging level names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
See Also:
Constant Field Values

FINEST

public static final int FINEST
See Also:
Constant Field Values

FINER

public static final int FINER
See Also:
Constant Field Values

FINE

public static final int FINE
See Also:
Constant Field Values

CONFIG

public static final int CONFIG
See Also:
Constant Field Values

INFO

public static final int INFO
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

SEVERE

public static final int SEVERE
See Also:
Constant Field Values

NONE

public static final int NONE
See Also:
Constant Field Values
Constructor Detail

Level

public Level()
Method Detail

isValidLevel

public static boolean isValidLevel(int checkLevel)
Checks if the parameter check level is one of the eight valid logging levels.

Parameters:
checkLevel - a potential level to be checked for validity.
Returns:
true if the parameter check level is one of the eight valid logging levels, otherwise false.

isValidLevel

public static boolean isValidLevel(java.lang.String checkLevel)
Checks if the parameter check level name is one of the eight valid logging level names.

Parameters:
checkLevel - a potential level name to be checked for validity.
Returns:
true if the parameter check level name is one of the eight valid logging level names, otherwise false.

getLevel

public static int getLevel(java.lang.String levelName)
Returns the integer level value for the parameter level String. The parameter level String could be either the English or the default locale level label (i.e. CONFIG), a property key (i.e. %LOGGING_LEVEL_CONFIG or LOGGING_LEVEL_CONFIG) or the level number as a String (i.e. 1).

Parameters:
levelName - a potential level String to be checked for its integer value.
Returns:
the integer level value for the parameter level String, or -1 if invalid.

getLevelName

public static java.lang.String getLevelName(int level)
Returns the String representation for the parameter logging level.

Parameters:
level - a potential logging level to be checked for its String representation.
Returns:
the String representation for the parameter logging level, or null if invalid.

getTranslatedLevelName

public static java.lang.String getTranslatedLevelName(int level)
Returns the translated String representation for the parameter logging level.

Parameters:
level - a potential logging level to be checked for its translated String representation.
Returns:
the translated String representation for the parameter logging level, or null if invalid.

getTranslatedLevelName

public static java.lang.String getTranslatedLevelName(java.lang.String levelName)
Returns the translated String representation for the parameter logging level String. The parameter level String could be either the English or the default locale level label (i.e. CONFIG), a property key (i.e. %LOGGING_LEVEL_CONFIG or LOGGING_LEVEL_CONFIG) or the level number as a String (i.e. 1).

Parameters:
levelName - a potential logging level String to be checked for its translated String representation.
Returns:
the translated String representation for the parameter logging level String, or null if invalid.

getLevelNames

public static java.lang.String[] getLevelNames()
Returns the array of the String representations of the eight logging levels.

Returns:
the array of the String representations of the eight logging levels.

getTranslatedLevelNames

public static java.lang.String[] getTranslatedLevelNames()
Returns the array of the String representations of the eight translated logging levels.

Returns:
the array of the String representations of the eight translated logging levels.