dev:logging_and_debugging
This is an old revision of the document!
Logging and Debugging
Here are a few quick tips on getting logging output from the simulator.
Key concepts
- The simulator has a logging system accessed via the static object
LOG
. - The logging system has a 'level' determining how much output is desired. The level can be set on the command line by the
-l NUM
switch, whereNUM
can range from 0 (for the least output) to 8 (for the most output). - The logging levels have names and numbers: NONE(0), ERROR(1), WARNING(2), MESSAGE(3), DEBUG(4), DEBUG1(5), DEBUG2(6), DEBUG3(7), and ALL(8).
- The logging code provides direct methods for producing output at levels ERROR, WARNING, MESSAGE, and DEBUG. For example:
LOG.Debug("Hi there");
prints 'Hi there' to the console and the logging buffer – if the logging level is 4 or larger.
LOG
offers simple, internally-implemented 'printf-like' functionality.
dev/logging_and_debugging.1411893897.txt.gz · Last modified: 2014/09/28 08:44 by ackley