Main Page Class Hierarchy Compound List File List Compound Members File Members
debug Class Reference
List of all members.
Detailed Description
An internal class used to implement the debugging framework.
You shouldn't use this class directly. Instead, use it like this:
DEBUG << "foo is " << foo
INFO << "Accepted connection from " << addr;
WARN << "...";
ERROR << "...";
FATAL << "Assertion failed";
CORE << "Assertion failed";
You can use feed just about anything, type-safely, as arguments to <<
(consider it varargs, C++ style).
This prints messages like the following to standard error:
debug [file.c:30] Foo is bar
info [file.c:31] Accepted connection from 18.7.16.73:9133
warn [file.c:32] ...
error [file.c:33] ...
fatal [file.c:34] Assertion failed
core! [file.c:35] Assertion failed
Well, actually, by default only warnings, errors, and fatal errors are reported. To enable more warnings, you can specify a debug level in the DEBUG
environment variable (1 to enable info messages, and 2 to enable debug messages).
Pretty soon you'll also be able to selectively set debugging levels by file or method, useful for debugging parts of your system without displaying crud from everywhere.
Note that DEBUG
, INFO
, WARN
, ERROR
, and FATAL
are macros.
Constructor & Destructor Documentation
Member Function Documentation
debug& debug::get |
( |
|
) |
[static] |
|
ostream& debug::get_debug_stream |
( |
|
) |
|
|
int debug::get_level_for_file |
( |
const char * |
file |
) |
|
|
bool debug::get_show_thread |
( |
|
) |
|
|
void debug::increase_verbosity_to |
( |
int |
level |
) |
|
|
bool debug::operator^ |
( |
const debug_msg & |
msg |
) |
|
|
void debug::set_debug_stream |
( |
ostream & |
out |
) |
|
|
void debug::set_show_thread |
( |
bool |
show_thread |
) |
|
|
The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:10 2002 for NMSTL