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";  // Also kills program
 CORE << "Assertion failed";   // Kills program, leaving core dump

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.


Public Methods

 Debug ()
 ~Debug ()
ostream & get_debug_stream ()
void set_debug_stream (ostream &out)
int get_level_for_file (const char *file)
void increase_verbosity_to (int level)
void set_show_thread (bool show_thread)
bool get_show_thread ()
bool operator^ (const DebugMsg &msg)

Static Public Methods

Debug & get ()


Constructor & Destructor Documentation

Debug::Debug  
 

Debug::~Debug  
 


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 DebugMsg &    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:11 2002 for NMSTL