|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.debug.DebugLogger
public class DebugLogger
Keep track of errors and waranings. The class is implemented as a singleton so that it can count the errors and warnings and give some statistics when the application shutsdown as a debugging aid.
Copyright (c) Xoetrope Ltd., 2002-2005
$Revision: 2.4 $ License: see license.txt
| Field Summary | |
|---|---|
static int |
DEBUG
output errors, dumps and exit messages |
static int |
NORMAL
only output error messages |
static int |
PARANOID
output all logging information |
static int |
SILENT
do not log anything |
static int |
VERBOSE
output debug messages, errors, dumps, exit massages, traces and log values |
| Constructor Summary | |
|---|---|
protected |
DebugLogger()
|
| Method Summary | |
|---|---|
static void |
dump()
Display log counts for warnings and errors |
static void |
dumpModel(XModel model)
Write a representation of the model to the console. |
static void |
enableZone(java.lang.String zone,
boolean state)
Enable/disable a debug zone |
static void |
exitApplication()
On exit this method will dump the contents of the debug log and close the VM |
static DebugLogger |
getInstance()
Get the logger instance |
static boolean |
isZoneEnabled(java.lang.String zone)
Check if a debug zone is enabled |
static void |
log(java.lang.String msg)
Write a message to the log |
static void |
logError(java.lang.String error)
Write an error message to the error stream. |
static void |
logError(java.lang.String zone,
java.lang.String error)
Write an error message to the error stream. |
static void |
logWarning(java.lang.String warning)
Write a warning message to the console. |
static void |
logWarning(java.lang.String zone,
java.lang.String warning)
Write a warning message to the console. |
static void |
readLoggerZones(XProject currentProject)
Read the debug zones file ("DebugZones.properties") |
static void |
setDebugLevel(int newLevel)
Set the logging level, by default the level is verbose NORMAL = 0, only output error messages DEBUG = 1, output errors, dumps and exit messages VERBOSE = 2, output debug messages, errors, dumps, exit massages, traces and log values PARANOID = 3, output all logging information |
static void |
setDebugLevel(java.lang.String newLevel)
Set the logging level, by default the level is verbose SILENT = -1, do not log anything NORMAL = 0, only output error messages DEBUG = 1, output errors, dumps and exit messages VERBOSE = 2, output debug messages, errors, dumps, exit massages, traces and log values PARANOID = 3, output all logging information |
static void |
setErrorWriter(XLogWriter writer)
Set the writer for the error output stream |
static void |
setLogListener(XLogListener logger)
Set a listener for log messsages |
static void |
setOutputWriter(XLogWriter writer)
Set the writer for the output stream |
static void |
trace(java.lang.String msg)
Write a message to the console. |
static void |
trace(java.lang.String msg,
double value)
Write a message to the console. |
static void |
trace(java.lang.String zone,
java.lang.String msg)
Write a message to the console. |
static void |
trace(XProject currentProject,
XModel model)
Write a snapshot of a model or model fragment to the log |
protected static void |
writeErrorLine(java.lang.String line)
Write an error line to the system error stream and log the message |
protected static void |
writeLine(java.lang.String line)
Write a line to the system output and log the message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int SILENT
public static final int NORMAL
public static final int DEBUG
public static final int VERBOSE
public static final int PARANOID
| Constructor Detail |
|---|
protected DebugLogger()
| Method Detail |
|---|
public static void exitApplication()
public static void dump()
public static DebugLogger getInstance()
public static void logError(java.lang.String zone,
java.lang.String error)
error - the error messagezone - the zone namepublic static void logError(java.lang.String error)
error - the error message
public static void logWarning(java.lang.String zone,
java.lang.String warning)
zone - the zone namewarning - the warning messagepublic static void logWarning(java.lang.String warning)
warning - the warning messagepublic static void log(java.lang.String msg)
msg - the message to log
public static void trace(java.lang.String zone,
java.lang.String msg)
zone - the zone namemsg - the log messagepublic static void trace(java.lang.String msg)
msg - the log message
public static void trace(java.lang.String msg,
double value)
msg - the log messagevalue - the value causing the trace
public static void trace(XProject currentProject,
XModel model)
currentProject - the owner projectmodel - the model node to logpublic static void dumpModel(XModel model)
model - the model node to dumppublic static void setDebugLevel(int newLevel)
newLevel - the new log levelpublic static void setDebugLevel(java.lang.String newLevel)
newLevel - the new log levelpublic static boolean isZoneEnabled(java.lang.String zone)
zone - the zone name
public static void enableZone(java.lang.String zone,
boolean state)
state - true to enable the zone, false otherwisezone - the zone nameprotected static void writeLine(java.lang.String line)
line - the message to logprotected static void writeErrorLine(java.lang.String line)
line - the message to logpublic static void setLogListener(XLogListener logger)
logger - the listenerpublic static void setOutputWriter(XLogWriter writer)
public static void setErrorWriter(XLogWriter writer)
public static void readLoggerZones(XProject currentProject)
currentProject - the owner project
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||