com.sap.tc.logging
Class Severity

java.lang.Object
  |
  +--com.sap.tc.logging.Severity

public class Severity
extends java.lang.Object

Collects constants for use as severities as well as some static utility methods. The order of the constants is, with increasing severity: DEBUG, PATH, INFO, WARNING, ERROR, FATAL.


Field Summary
static int ALL
          Severity that allows all messages to be written.
static int DEBUG
          Recommended severity for debug messages.
static int ERROR
          Recommended severity of error messages.
static int FATAL
          Recommended severity of fatal error messages.
static int GROUP
          Group severity.
static int INFO
          Recommended severity for informational messages.
static int MAX
          Maximum severity.
static int MIN
          Minimum severity.
static int NONE
          Severity that prohibits any messages to be written.
static int PATH
          Recommended severity for path messages.
static java.util.List VALUES
          List of predefined severity levels (unmodifiable).
static int WARNING
          Recommended severity of warning messages.
 
Constructor Summary
Severity()
           
 
Method Summary
static void check(int severity)
          Checks whether a severity is within the valid range.
static int correct(int severity)
          Corrects an invalid severity to the closest valid value.
static void msgCheck(int severity)
          Checks whether a severity is within the valid range for messages.
static int msgCorrect(int severity)
          Corrects an invalid severity for a message to the closest valid value.
static int parse(java.lang.String name)
          Gets the severity of the symbolic constant with the specified name.
static java.lang.String toString(int severity)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL
Severity that allows all messages to be written.

DEBUG

public static final int DEBUG
Recommended severity for debug messages. Debug messages give detailed information on program execution, above all to developers themselves.

PATH

public static final int PATH
Recommended severity for path messages. Path messages outline the path of program execution, above all for developers themselves. Typical applications of path messages are method entries and exits.

INFO

public static final int INFO
Recommended severity for informational messages.

WARNING

public static final int WARNING
Recommended severity of warning messages. Warnings inform about supposed problems which can but need not lead to errors later.

ERROR

public static final int ERROR
Recommended severity of error messages. Error messages inform about problems the component most probably can recover from.

FATAL

public static final int FATAL
Recommended severity of fatal error messages. Fatal errors are problems a component cannot recover from without significant intervention from operators or developers.

MIN

public static final int MIN
Minimum severity.

MAX

public static final int MAX
Maximum severity.

GROUP

public static final int GROUP
Group severity. Special constant for designating group messages.

NONE

public static final int NONE
Severity that prohibits any messages to be written.

VALUES

public static final java.util.List VALUES
List of predefined severity levels (unmodifiable).
Constructor Detail

Severity

public Severity()
Method Detail

toString

public static java.lang.String toString(int severity)

check

public static void check(int severity)
Checks whether a severity is within the valid range.
Throws:
java.lang.IllegalArgumentException - Specified severity is smaller than MIN or larger than MAX, and neither NONE nor ALL nor GROUP

msgCheck

public static void msgCheck(int severity)
Checks whether a severity is within the valid range for messages.
Throws:
java.lang.IllegalArgumentException - Specified severity is smaller than MIN or larger than MAX

correct

public static int correct(int severity)
Corrects an invalid severity to the closest valid value.
Returns:
Corrected severity

msgCorrect

public static int msgCorrect(int severity)
Corrects an invalid severity for a message to the closest valid value.
Returns:
Corrected severity

parse

public static int parse(java.lang.String name)
Gets the severity of the symbolic constant with the specified name.
Parameters:
name - Name of symbolic severity constant. Case INSENSITIVE.
Throws:
java.lang.IllegalArgumentException - Specified name is not a symbolic severity constant