|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.perforce.api.Debug
Utility class used for debugging. The level of debugging
determines the amount of debugging information that is generated. The
process using this class for debugging should ensure that it
sets the debugging level
appropriately.
Field Summary | |
static int |
ERROR
Only error messages are displayed. |
static int |
LOG_NONE
Debugging output is discarded entirely. |
static int |
LOG_ONLY
Debugging output is sent only to the EventLog . |
static int |
LOG_SPLIT
Debugging output is sent to standard out and to the EventLog . |
static int |
NONE
No debug messages are displayed. |
static int |
NOTICE
Error, warning, and notice messages are displayed. |
static int |
VERBOSE
Error, warning, notice, and verbose messages are displayed. |
static int |
WARNING
Error and warning messages are displayed. |
Constructor Summary | |
Debug()
|
Method Summary | |
static void |
error(String msg)
Displays an error message for debugging. |
static int |
getDebugLevel()
Returns the current debug level. |
static EventLog |
getEventLog()
Returns the current EventLog in use. |
static String |
getLevelName(int level)
Returns the name associated with the specified level. |
static int |
getLogLevel()
Returns the current logging level. |
static boolean |
getShowThread()
Returns the state of showing threads in degugging output. |
static void |
notify(String msg)
Displays a notice message for debugging. |
static void |
notify(String msg,
String[] arry)
Displays a notice message for debugging. |
static void |
out(int level,
String msg)
Writes the message to the debugging output. |
static void |
out(int level,
String msg,
String[] arry)
Writes the message and associated array of Strings to the debugging output. |
static void |
out(int level,
Throwable t)
Writes the message associated with the Throwable to the
debugging output. |
static void |
out(String format,
int level,
Throwable t)
Writes the formatted message associated with the Throwable to the
debugging output. |
static void |
setDebugLevel(int l)
Sets the debug level for the application. |
static void |
setEventLog(EventLog elog)
Sets the EventLog that debugging output should be sent to. |
static void |
setLogLevel(int log_level)
Sets the logging level. |
static void |
setLogLevel(String level)
Sets the logging level. |
static void |
setProperties(Properties props)
Sets the logging level from the supplied Properties . |
static void |
setShowThread(boolean show)
If set true , the thread number is included in all debugging
output. |
static void |
verbose(String msg)
Displays a verbose message for debugging. |
static void |
verbose(String msg,
String[] arry)
Displays a verbose message for debugging. |
static void |
warn(String msg)
Displays a warning message for debugging. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int ERROR
public static final int LOG_NONE
public static final int LOG_ONLY
EventLog
.public static final int LOG_SPLIT
EventLog
.public static final int NONE
public static final int NOTICE
public static final int VERBOSE
public static final int WARNING
Constructor Detail |
public Debug()
Method Detail |
public static void error(String msg)
msg
- The debugging error message.public static int getDebugLevel()
setDebugLevel(int)
public static EventLog getEventLog()
EventLog
in use.public static String getLevelName(int level)
setDebugLevel(int)
public static int getLogLevel()
public static boolean getShowThread()
public static void notify(String msg)
msg
- The debugging notice message.public static void notify(String msg, String[] arry)
msg
- The debugging notice message.arry
- Array containing useful debug information.public static void out(int level, String msg)
level
- Debugging level to associate with the message.msg
- Debugging message.public static void out(int level, String msg, String[] arry)
arry
.level
- Debugging level to associate with the message.msg
- Debugging message.arry
- Array of strings to be sent to the debugging output.public static void out(int level, Throwable t)
Throwable
to the
debugging output.level
- Debugging level to associate with the message.t
- Throwable that contains the message.public static void out(String format, int level, Throwable t)
Throwable
to the
debugging output. The message will be placed in the string generated
wherever the '{0}' attribute is placed.format
- Format to use for the debugging output.level
- Debugging level to associate with the message.t
- Throwable that contains the message.java.text.MessageFormat
public static void setDebugLevel(int l)
l
- The level of debugging to use.NONE
,
ERROR
,
WARNING
,
NOTICE
,
VERBOSE
public static void setEventLog(EventLog elog)
EventLog
that debugging output should be sent to.elog
- EventLog
to use.public static void setLogLevel(int log_level)
LOG_SPLIT
,
LOG_ONLY
, and LOG_NONE
. The default is
LOG_ONLY
.
If the log level is set to LOG_NONE
, then the debug
level is automatically set to NONE
.
public static void setLogLevel(String level)
String
does
not match.public static void setProperties(Properties props)
Properties
. This
looks for the "p4.log_level" property with the value of either "none",
"split", or "only".public static void setShowThread(boolean show)
true
, the thread number is included in all debugging
output.public static void verbose(String msg)
msg
- The debugging notice message.public static void verbose(String msg, String[] arry)
msg
- The debugging notice message.arry
- Array containing useful debug information.public static void warn(String msg)
msg
- The debugging warning message.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |