org.mozilla.jss.util

Class Debug


public class Debug
extends java.lang.Object

Controls debug-mode operation of JSS classes, and allows for printing trace statements to standard output.
See Also:
Assert

Field Summary

static boolean
DEBUG
Controls debug mode for JSS.
static int
ERROR
static int
OBNOXIOUS
static int
QUIET
static int
VERBOSE

Method Summary

static int
getLevel()
Get debugging level of the application.
static String
getLevelStr()
static void
setLevel(int level)
Set the debugging level of the application.
static void
trace(String str)
Print a trace statement to standard output.
static void
trace(int level, String str)
Print a trace statement to standard output.

Field Details

DEBUG

public static final boolean DEBUG
Controls debug mode for JSS. If DEBUG==true, debugging code will be enabled. If DEBUG==false, debugging code will not be executed. This variable does not influence the printing of trace statements; their execution depends on the debug level, which can be accessed through setLevel and getLevel.
Field Value:
true

ERROR

public static final int ERROR
Field Value:
1

OBNOXIOUS

public static final int OBNOXIOUS
Field Value:
10

QUIET

public static final int QUIET
Field Value:
0

VERBOSE

public static final int VERBOSE
Field Value:
5

Method Details

getLevel

public static int getLevel()
Get debugging level of the application.
Returns:
The current debugging level of the application.

getLevelStr

public static String getLevelStr()

setLevel

public static void setLevel(int level)
Set the debugging level of the application. The level must not be negative.

trace

public static void trace(String str)
Print a trace statement to standard output. Uses the VERBOSE detail level.
Parameters:
str - The trace statement.

trace

public static void trace(int level,
                         String str)
Print a trace statement to standard output.
Parameters:
level - The detail level of the statement. The level must be greater than 0.
str - The trace statement.