simpledb
Class Debug

java.lang.Object
  extended by simpledb.Debug

public class Debug
extends java.lang.Object

Debug is a utility class that wraps println statements and allows more or less command line output to be turned on.

Change the value of the DEBUG_LEVEL constant using a system property: simpledb.Debug. For example, on the command line, use -Dsimpledb.Debug=x, or simply -Dsimpledb.Debug to enable it at level 0. The log(level, message, ...) method will print to standard output if the level number is less than or equal to the currently set DEBUG_LEVEL.


Field Summary
private static int DEBUG_LEVEL
           
private static int DEFAULT_LEVEL
           
 
Constructor Summary
Debug()
           
 
Method Summary
static boolean isEnabled()
           
static boolean isEnabled(int level)
           
static void log(int level, java.lang.String message, java.lang.Object... args)
          Log message if the log level >= level.
static void log(java.lang.String message, java.lang.Object... args)
          Logs message at the default log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG_LEVEL

private static final int DEBUG_LEVEL

DEFAULT_LEVEL

private static final int DEFAULT_LEVEL
See Also:
Constant Field Values
Constructor Detail

Debug

public Debug()
Method Detail

log

public static void log(int level,
                       java.lang.String message,
                       java.lang.Object... args)
Log message if the log level >= level. Uses printf.


isEnabled

public static boolean isEnabled(int level)
Returns:
true if level is being logged.

isEnabled

public static boolean isEnabled()
Returns:
true if the default level is being logged.

log

public static void log(java.lang.String message,
                       java.lang.Object... args)
Logs message at the default log level.