|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.jaw.reference.common.Debug
This class provides methods for printing debug messages or logging them to a file. It is possible to specify the trace level of the debug messages. All the classes of the Java Dynamic Management Kit use this class for printing debug messages. You can use this class in your own code for printing debug messages for your own classes.
It is possible to specify the trace level in either of the following ways:
The system properties for specifying a trace level are:
Property | Trace Level |
---|---|
DEBUG | All messages |
DEFAULT | Messages that are not associated with a predefined trace level |
DEBUG_ADP | Messages from the adaptors |
DEBUG_CMF | Messages from the framework |
DEBUG_DISCO | Messages from the discovery service |
DEBUG_EXCPT | Exceptions |
DEBUG_META | Messages from the metadata service |
DEBUG_MLET | Messages from the m-let service |
DEBUG_REL | Messages from the relationship service |
DEBUG_REP | Messages from the repository service |
DEBUG_SNMP | Messages from the SNMP Manager service |
DEBUG_THREAD | Messages from the Thread Allocator service |
DEBUG_TRACE | Messages from any class |
In addition, the DEBUG_HEAVY
property can be set to
get additional traces. Setting the DEBUG
property will not
switch on the heavy printing.
To specify that debug messages are logged to a file, specify the
DEBUG_OUTPUT=
filename system property.
The setDefault method enables or disables default mode. If default mode is enabled, messages for the selected trace level and messages not associated with a predefined trace level are printed. If default mode is disabled, no messages that are not associated with a predefined trace level are printed. Only messages for the selected trace level are printed. By default, the default mode is disabled.
Field Summary | |
static int |
ADP_DEBUG
Trace level for the adaptors. |
static int |
CMF_DEBUG
Trace level for the framework. |
static int |
DISCO_DEBUG
Trace level for the discovery service. |
static int |
EXCPT_DEBUG
Trace level for exceptions. |
static int |
HEAVY_DEBUG
Trace level for getting very talkative traces. |
static int |
META_DEBUG
Trace level for the metadata service. |
static int |
MLET_DEBUG
Trace level for the m-let service. |
static int |
NO_DEBUG
No trace. |
static int |
REL_DEBUG
Trace level for relationship service. |
static int |
REP_DEBUG
Trace level for the repository service. |
static int |
SNMP_DEBUG
Trace level for the Snmp Manager service. |
static int |
THREAD_DEBUG
Trace level for the thread allocator service. |
static int |
TRACE_DEBUG
Trace level for any class. |
Constructor Summary | |
Debug()
|
Method Summary | |
static void |
flush()
Flushes the trace stream. |
static int |
getLevel()
Gets the currently selected trace levels. |
static java.io.PrintWriter |
getLog()
Gets the current log used for logging debug messages. |
static boolean |
isLevelSet(int atLevel)
Check if atLevel is set. |
static void |
parseDebugProperties()
Parses the system properties specified at the command-line to determine the specified trace level. |
static void |
print(boolean condition,
java.lang.Object arg)
Traces an object according a condition. |
static void |
print(int atLevel,
java.lang.Object arg)
Traces an object with a specific trace level. |
static void |
print(java.lang.Object arg)
Traces an object. |
static void |
printException(java.lang.Exception e)
Traces an exception. |
static void |
printFormatted(java.lang.Object arg)
Write a message on the printer stream associated with the Debug
object. |
static void |
println(boolean condition,
java.lang.Object arg)
Traces an object according a condition and appends a carriage return. |
static void |
println(int atLevel,
java.lang.Object arg)
Traces an object with a specific level and appends a carriage return. |
static void |
println(java.lang.Object arg)
Traces an object and appends a carriage return. |
static void |
setDefault(boolean mode)
Enables or disables default mode. |
static void |
setLevel(int l)
Sets the trace level. |
static void |
setLog(java.io.PrintWriter l)
Sets the log for debug messages. |
static void |
setOff(int forLevel)
Deactivates a specific trace level. |
static void |
setOffAll()
Deactivates all trace levels, so that no debug messages will be printed. |
static void |
setOn(int forLevel)
Activates a specific trace level. |
static void |
setOnAll()
Activates all trace levels, so that debug messages for all traces will be printed. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final int NO_DEBUG
public static final int CMF_DEBUG
DEBUG_CMF
system property.public static final int ADP_DEBUG
DEBUG_ADP
system property.public static final int REP_DEBUG
DEBUG_REPO
system property.public static final int EXCPT_DEBUG
DEBUG_EXCPT
system property.public static final int META_DEBUG
DEBUG_META
system property.public static final int TRACE_DEBUG
public static final int REL_DEBUG
DEBUG_RELA
system property.public static final int MLET_DEBUG
DEBUG_MLET
system property.public static final int DISCO_DEBUG
DEBUG_DISCO
system property.public static final int SNMP_DEBUG
DEBUG_SNMP
system property.public static final int HEAVY_DEBUG
DEBUG_HEAVY
system property.public static final int THREAD_DEBUG
DEBUG_THREAD
system property.Constructor Detail |
public Debug()
Method Detail |
public static void printFormatted(java.lang.Object arg)
Debug
object.
If the stream is null, the method will use System.err
The method will pritn the object regardless the setting of the trace level.public static void flush()
public static void print(java.lang.Object arg)
public static void print(int atLevel, java.lang.Object arg)
public static void print(boolean condition, java.lang.Object arg)
condition
is true and the default mode is enabled,
the object is printed on the trace stream.public static void println(java.lang.Object arg)
public static void println(int atLevel, java.lang.Object arg)
public static void println(boolean condition, java.lang.Object arg)
condition
is true and the default mode is enabled,
the object is printed on the trace stream.public static void printException(java.lang.Exception e)
EXCPT_DEBUG
is not activated,
nothing is printed.public static void parseDebugProperties()
public static boolean isLevelSet(int atLevel)
atLevel
is set.public static int getLevel()
public static java.io.PrintWriter getLog()
PrintWriter
stream used for logging
debug messages.public static void setOnAll()
public static void setOn(int forLevel)
forLevel
- The trace level to be activated.public static void setOffAll()
public static void setOff(int forLevel)
forLevel
- The trace level to be deactivated.public static void setLevel(int l)
l
- The new trace level.public static void setDefault(boolean mode)
By default, the default mode is disabled.
mode
- true
to enable default mode or false
to disable default mode.public static void setLog(java.io.PrintWriter l)
l
- The PrintWriter
stream to be used for logging
debug messages.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |