|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.util.LoggableOp
public class LoggableOp
This is an abstract base class for objects that need to log error or warning messages. It is useful for things like parsers and printers -- anything that need to perform a complex operation but might encounter errors that need to be displayed to the user.
Field Summary | |
---|---|
protected boolean |
_verbose
|
Constructor Summary | |
---|---|
LoggableOp()
|
Method Summary | |
---|---|
int |
getErrorCount()
Get the number of errors generated during the most recent operation. |
PrintStream |
getErrorStream()
Get the stream to which errors are printed. |
int |
getLineNumber()
|
int |
getWarningCount()
Get the number of warnings generated during the most recent parse. |
void |
indent()
Increment the indentation counter. |
boolean |
isVerbose()
Test if we are in verbose mode |
void |
logError(String msg)
Print an error message to the error stream. |
void |
logError(String id,
String msg)
Print an error message to the error stream. |
void |
logError(String id,
String msg,
String detail)
Print an error message to the error stream. |
void |
logInfo(String msg)
If in verbose mode, print an info message to the error stream, otherwise do nothing. |
void |
logInfo(String id,
String msg)
If in verbose mode, print an info message to the error stream, otherwise do nothing. |
void |
logWarning(String msg)
Print an warning message to the error stream. |
void |
logWarning(String id,
String msg)
Print an warning message to the error stream. |
void |
logWarning(String id,
String msg,
String detail)
Print an warning message to the error stream. |
void |
reset()
Reset the error counters. |
void |
setErrorStream(PrintStream err)
Set the stream to which errors are printed. |
void |
setVerbose(boolean v)
Set the verbose mode flag. |
void |
unindent()
Decrement the indentation counter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean _verbose
Constructor Detail |
---|
public LoggableOp()
Method Detail |
---|
public int getErrorCount()
public PrintStream getErrorStream()
public int getWarningCount()
public int getLineNumber()
public void logError(String msg)
public void logError(String id, String msg)
public void logError(String id, String msg, String detail)
public void logInfo(String msg)
public void logInfo(String id, String msg)
public void indent()
public final boolean isVerbose()
public void reset()
public void setErrorStream(PrintStream err)
public void setVerbose(boolean v)
public void unindent()
public void logWarning(String msg)
public void logWarning(String id, String msg)
public void logWarning(String id, String msg, String detail)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |