Perforce

com.perforce.api
Class Debug

java.lang.Object
  |
  +--com.perforce.api.Debug

public final class Debug
extends Object

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.

Version:
$Date: 2001/11/02 $ $Revision: #1 $
Author:
David Markley

Field Summary
static int ERROR
          Only error messages are displayed.
static int LOG_NONE
           
static int LOG_ONLY
           
static int LOG_SPLIT
           
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()
           
static EventLog getEventLog()
           
static String getLevelName(int level)
           
static int getLogLevel()
           
static boolean getShowThread()
           
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)
           
static void out(int level, String msg, String[] arry)
           
static void out(int level, Throwable t)
           
static void out(String format, int level, Throwable t)
           
static void setDebugLevel(int l)
          Sets the debug level for the application.
static void setEventLog(EventLog elog)
           
static void setLogLevel(int log_level)
           
static void setLogLevel(String level)
           
static void setProperties(Properties props)
           
static void setShowThread(boolean show)
           
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

ERROR

public static final int ERROR
Only error messages are displayed.

LOG_NONE

public static final int LOG_NONE

LOG_ONLY

public static final int LOG_ONLY

LOG_SPLIT

public static final int LOG_SPLIT

NONE

public static final int NONE
No debug messages are displayed.

NOTICE

public static final int NOTICE
Error, warning, and notice messages are displayed.

VERBOSE

public static final int VERBOSE
Error, warning, notice, and verbose messages are displayed.

WARNING

public static final int WARNING
Error and warning messages are displayed.
Constructor Detail

Debug

public Debug()
Method Detail

error

public static void error(String msg)
Displays an error message for debugging. If the debugging level is set below ERROR, then no message is displayed.
Parameters:
msg - The debugging error message.

getDebugLevel

public static int getDebugLevel()

getEventLog

public static EventLog getEventLog()

getLevelName

public static String getLevelName(int level)

getLogLevel

public static int getLogLevel()

getShowThread

public static boolean getShowThread()

notify

public static void notify(String msg)
Displays a notice message for debugging. If the debugging level is set below NOTICE, then no message is displayed.
Parameters:
msg - The debugging notice message.

notify

public static void notify(String msg,
                          String[] arry)
Displays a notice message for debugging. If the debugging level is set below NOTICE, then no message is displayed.
Parameters:
msg - The debugging notice message.
arry - Array containing useful debug information.

out

public static void out(int level,
                       String msg)

out

public static void out(int level,
                       String msg,
                       String[] arry)

out

public static void out(int level,
                       Throwable t)

out

public static void out(String format,
                       int level,
                       Throwable t)

setDebugLevel

public static void setDebugLevel(int l)
Sets the debug level for the application. If this is 0, no debug information is generated.
Parameters:
l - The level of debugging to use.
See Also:
NONE, ERROR, WARNING, NOTICE, VERBOSE

setEventLog

public static void setEventLog(EventLog elog)

setLogLevel

public static void setLogLevel(int log_level)

setLogLevel

public static void setLogLevel(String level)

setProperties

public static void setProperties(Properties props)

setShowThread

public static void setShowThread(boolean show)

verbose

public static void verbose(String msg)
Displays a verbose message for debugging. If the debugging level is set below VERBOSE, then no message is displayed.
Parameters:
msg - The debugging notice message.

verbose

public static void verbose(String msg,
                           String[] arry)
Displays a verbose message for debugging. If the debugging level is set below VERBOSE, then no message is displayed.
Parameters:
msg - The debugging notice message.
arry - Array containing useful debug information.

warn

public static void warn(String msg)
Displays a warning message for debugging. If the debugging level is set below WARNING, then no message is displayed.
Parameters:
msg - The debugging warning message.

Perforce

Copyright © 2001, Perforce Software, All rights reserved.