| java.lang.Object net.xoetrope.debug.DebugLogger
DebugLogger | public class DebugLogger (Code) | | 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-2004
$Revision: 1.20 $
|
Field Summary | |
final public static int | DEBUG | final public static int | NORMAL | final public static int | PARANOID | final public static int | SILENT | final public static int | VERBOSE |
DEBUG | final public static int DEBUG(Code) | | |
NORMAL | final public static int NORMAL(Code) | | |
PARANOID | final public static int PARANOID(Code) | | |
SILENT | final public static int SILENT(Code) | | |
VERBOSE | final public static int VERBOSE(Code) | | |
DebugLogger | protected DebugLogger()(Code) | | |
dump | public static void dump()(Code) | | Display log counts for warnings and errors
|
dumpModel | public static void dumpModel(XModel model)(Code) | | Write a representation of the model to the console.
Parameters: model - |
exitApplication | public static void exitApplication()(Code) | | On exit this method will dump the contents of the debug log and close the VM
|
getInstance | public static DebugLogger getInstance()(Code) | | Get the logger instance
the DebugLogger instance |
log | public static void log(String msg)(Code) | | Write a message to the log
Parameters: msg - the message to log |
logError | public static void logError(String error)(Code) | | Write an error message to the error stream. Errors are logged unless the
logLevel is SILENT
Parameters: error - the error message |
logWarning | public static void logWarning(String warning)(Code) | | Write a warning message to the console. Warnings are logged unless the
logLevel is less than DEBUG or unless the DEBUG build property is set to false
Parameters: warning - the warning message |
setDebugLevel | public static void setDebugLevel(int newLevel)(Code) | | 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
Parameters: newLevel - the new log level |
setDebugLevel | public static void setDebugLevel(String newLevel)(Code) | | 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
Parameters: newLevel - the new log level |
setLogListener | public static void setLogListener(XLogListener logger)(Code) | | Set a listener for log messsages
Parameters: logger - the listener |
trace | public static void trace(String msg)(Code) | | Write a message to the console. Trace messages are logged unless the
logLevel is less than VERBOSE or unless the DEBUG build property is set to false
Parameters: msg - the log message |
trace | public static void trace(String msg, double value)(Code) | | Write a message to the console. The message is assumed to have a substitution
for a numeric value e.g. 'TRACE: The X value is VALUE: 1.09'
Trace messages are logged unless the logLevel is less than VERBOSE or
unless the DEBUG build property is set to false
Parameters: msg - the log message Parameters: value - the value causing the trace |
trace | public static void trace(XModel model)(Code) | | Write a snapshot of a model or model fragment to the log
Parameters: model - the model node to log |
writeErrorLine | protected static void writeErrorLine(String line)(Code) | | Write an error line to the system error stream and log the message
Parameters: line - the message to log |
writeLine | protected static void writeLine(String line)(Code) | | Write a line to the system output and log the message
Parameters: line - the message to log |
|
|