public class PS_Debug
extends java.lang.Object
The prefix string, which occurs at the beginning of the debug output,
is configurable through the environment variable
PS_DEBUG_PREFIX
. It has a default value of "PS_DEBUG".
The separator string, which separates the prefix, debug level string,
and the given debug message string,
is configurable through the environment variable
PS_DEBUG_SEPARATOR
. It has a default value of ":".
Modifier and Type | Field and Description |
---|---|
static int |
FATAL |
static int |
INFO |
static int |
OFF |
static java.lang.String |
prefix |
static int |
VERBOSE |
static int |
WARNING |
Constructor and Description |
---|
PS_Debug() |
Modifier and Type | Method and Description |
---|---|
static void |
errorExit(java.lang.String msg)
Prints given message to standard error,
and exit with code 1.
|
static int |
getLevel()
Returns the debug level as set by the environment variable
PS_DEBUG; 0 means no debug information, positive integer
means to print out debug information.
|
static java.lang.String |
getPrefix() |
static void |
print(int lev,
java.lang.String msg)
Prints given debug message to standard out
if the current debug level is no lower than the given level;
does not print if given level is 0 or negative.
|
static void |
setLevel(int lev)
Sets debug level to given value.
|
static void |
setPrefix(java.lang.String pre) |
public static java.lang.String prefix
public static final int OFF
public static final int FATAL
public static final int WARNING
public static final int INFO
public static final int VERBOSE
public static void setLevel(int lev)
public static int getLevel()
public static java.lang.String getPrefix()
public static void setPrefix(java.lang.String pre)
public static void print(int lev, java.lang.String msg)
public static void errorExit(java.lang.String msg)