com.sap.tc.logging

Class Severity

java.lang.Object
  extended by com.sap.tc.logging.Severity

public class Severity
extends 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.
protected static String INVALID_SEVERITY_EMSG
           
static int MAX
          Maximum severity.
static int MIN
          Minimum severity.
static int NONE
          Severity that prohibits any messages to be written.
protected static int OFFSET
          Offset in between recommended severities.
static int PATH
          Recommended severity for path messages.
protected static String UNKNOWN_SEVERITY_EMSG
           
static 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(String name)
          Gets the severity of the symbolic constant with the specified name.
static String toString(int severity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OFFSET

protected static final int OFFSET
Offset in between recommended severities.

See Also:
Constant Field Values

ALL

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

See Also:
Constant Field Values

DEBUG

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

INFO

public static final int INFO
Recommended severity for informational messages.

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

ERROR

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

See Also:
Constant Field Values

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.

See Also:
Constant Field Values

MIN

public static final int MIN
Minimum severity.

See Also:
Constant Field Values

MAX

public static final int MAX
Maximum severity.

See Also:
Constant Field Values

GROUP

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

See Also:
Constant Field Values

NONE

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

See Also:
Constant Field Values

VALUES

public static final List VALUES
List of predefined severity levels (unmodifiable).


INVALID_SEVERITY_EMSG

protected static final String INVALID_SEVERITY_EMSG
See Also:
Constant Field Values

UNKNOWN_SEVERITY_EMSG

protected static final String UNKNOWN_SEVERITY_EMSG
See Also:
Constant Field Values
Constructor Detail

Severity

public Severity()
Method Detail

toString

public static String toString(int severity)

check

public static void check(int severity)
Checks whether a severity is within the valid range.

Throws:
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:
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(String name)
Gets the severity of the symbolic constant with the specified name.

Parameters:
name - Name of symbolic severity constant. Case INSENSITIVE.
Throws:
IllegalArgumentException - Specified name is not a symbolic severity constant
Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/ddic/ddicruntime
[sap.com] ENGINEAPI [sap.com] tc/logging
[sap.com] ENGFACADE [sap.com] tc/bl/logging/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib
[sap.com] BRMS-FACADE [sap.com] tc/brms/facade


Copyright 2010 SAP AG Complete Copyright Notice