edu.stanford.nlp.util
Class Dbg

java.lang.Object
  |
  +--edu.stanford.nlp.util.Dbg

public class Dbg
extends Object

This class now combines two sets of debugging calls: Chris': Centralize the debugging print-outs, and make them more efficient when turned off at runtime. Always use if (Dbg.WHATEVER) Dbg.print(str); Then string isn't constructed if debugging is turned off

Sep's: Debugging class. Variables and Methods involved in debugging code. The variable verbosity gives a level of "loudness". The higher the value of verbosity, the more debugging statements will be printed.

verbosity
0 -- silent
1 -- prints necessary output, but no debugging statements
10 -- very loud . . . prints all debugging values


Field Summary
static boolean ERROR
           
static boolean FIVE
           
static boolean FOUR
           
static boolean ONE
           
static boolean PARSE
           
static boolean PROGRESS
           
static boolean SIX
           
static boolean THREE
           
static boolean TIMING
           
static boolean TWO
           
static boolean VERBOSE
           
static int verbosity
           
static boolean WARNING
           
 
Constructor Summary
Dbg()
           
 
Method Summary
static void close()
           
static void linePrint(int line, String s)
           
static void print(String s)
          Print the debug message to a file or stderr
static void println(int v, String s)
          prints string s only if the verbosity exceeds v
static void printToFile(String filename, String message)
          Prints to a file.
static void printToFile(String filename, String message, boolean append)
          Prints to a file.
static void setVerbosity(int v)
          Sets the verbosity to v.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERROR

public static final boolean ERROR
See Also:
Constant Field Values

WARNING

public static final boolean WARNING
See Also:
Constant Field Values

TIMING

public static final boolean TIMING
See Also:
Constant Field Values

VERBOSE

public static final boolean VERBOSE
See Also:
Constant Field Values

PARSE

public static final boolean PARSE
See Also:
Constant Field Values

PROGRESS

public static final boolean PROGRESS
See Also:
Constant Field Values

ONE

public static final boolean ONE
See Also:
Constant Field Values

TWO

public static final boolean TWO
See Also:
Constant Field Values

THREE

public static final boolean THREE
See Also:
Constant Field Values

FOUR

public static final boolean FOUR
See Also:
Constant Field Values

FIVE

public static final boolean FIVE
See Also:
Constant Field Values

SIX

public static final boolean SIX
See Also:
Constant Field Values

verbosity

public static int verbosity
Constructor Detail

Dbg

public Dbg()
Method Detail

print

public static void print(String s)
Print the debug message to a file or stderr

Parameters:
s - The string to print

linePrint

public static void linePrint(int line,
                             String s)

close

public static void close()

setVerbosity

public static void setVerbosity(int v)
Sets the verbosity to v.


println

public static void println(int v,
                           String s)
prints string s only if the verbosity exceeds v


printToFile

public static void printToFile(String filename,
                               String message,
                               boolean append)
Prints to a file. If the file already exists, appends if append=true, and overwrites if append=false


printToFile

public static void printToFile(String filename,
                               String message)
Prints to a file. If the file does not exist, rewrites the file; does not append.



Stanford NLP Group