Debugger Class Reference
An object that logs messages on creation and destruction.
More...
#include <yateclass.h>
List of all members.
Public Types |
enum | Formatting { None = 0,
Relative,
Absolute,
Textual
} |
Public Member Functions |
| Debugger (const char *name, const char *format=0,...) |
| Debugger (int level, const char *name, const char *format=0,...) |
| ~Debugger () |
Static Public Member Functions |
static void | setOutput (void(*outFunc)(const char *, int)=0) |
static void | setIntOut (void(*outFunc)(const char *, int)=0) |
static void | enableOutput (bool enable=true, bool colorize=false) |
static void | setFormatting (Formatting format) |
Detailed Description
An object that logs messages on creation and destruction.
This class is used as an automatic variable that logs messages on creation and destruction (when the instruction block is left or function returns). IMPORTANT: the name is not copied so it should best be static.
Member Enumeration Documentation
Constructor & Destructor Documentation
Debugger |
( |
const char * |
name, |
|
|
const char * |
format = 0 , |
|
|
|
... | |
|
) |
| | |
The constructor prints the method entry message and indents.
- Parameters:
-
| name | Name of the function or block entered, must be static |
| format | printf() style format string |
Debugger |
( |
int |
level, |
|
|
const char * |
name, |
|
|
const char * |
format = 0 , |
|
|
|
... | |
|
) |
| | |
The constructor prints the method entry message and indents.
- Parameters:
-
| level | The level of the message |
| name | Name of the function or block entered, must be static |
| format | printf() style format string |
The destructor prints the method leave message and deindents.
Member Function Documentation
static void enableOutput |
( |
bool |
enable = true , |
|
|
bool |
colorize = false | |
|
) |
| | [static] |
Enable or disable the debug output
- Parameters:
-
| enable | Set to true to globally enable output |
| colorize | Enable ANSI colorization of output |
static void setFormatting |
( |
Formatting |
format |
) |
[static] |
Set the format of timestamps on output messages and set the time start reference
- Parameters:
-
| format | Desired timestamp formatting |
static void setIntOut |
( |
void(*)(const char *, int) |
outFunc = 0 |
) |
[static] |
Set the interactive output callback
- Parameters:
-
| outFunc | Pointer to the output function, NULL to disable |
static void setOutput |
( |
void(*)(const char *, int) |
outFunc = 0 |
) |
[static] |
Set the output callback
- Parameters:
-
| outFunc | Pointer to the output function, NULL to use stderr |
The documentation for this class was generated from the following file: