class Debugger

An object that logs messages on creation and destruction. More...

Full nameTelEngine::Debugger
Definition#include <yateclass.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Static Methods


Detailed Description

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.

enum Formatting { None = 0, Relative, Absolute, Textual, TextLocal, }

Formatting

Timestamp formatting

explicit  Debugger (const char* name, const char* format = 0, ...)

Debugger

The constructor prints the method entry message and indents.

Parameters:
nameName of the function or block entered, must be static
formatprintf() style format string

 Debugger (int level, const char* name, const char* format = 0, ...)

Debugger

The constructor prints the method entry message and indents.

Parameters:
levelThe level of the message
nameName of the function or block entered, must be static
formatprintf() style format string

 ~Debugger ()

~Debugger

The destructor prints the method leave message and deindents.

void  setOutput (void (*outFunc)(const char*,int) = 0)

setOutput

[static]

Set the output callback

Parameters:
outFuncPointer to the output function, NULL to use stderr

void  setIntOut (void (*outFunc)(const char*,int) = 0)

setIntOut

[static]

Set the interactive output callback

Parameters:
outFuncPointer to the output function, NULL to disable

void  enableOutput (bool enable = true, bool colorize = false)

enableOutput

[static]

Enable or disable the debug output

Parameters:
enableSet to true to globally enable output
colorizeEnable ANSI colorization of output

Formatting  getFormatting ()

getFormatting

[static]

Retrieve the format of timestamps

Returns: The current formatting type for timestamps

void  setFormatting (Formatting format)

setFormatting

[static]

Set the format of timestamps on output messages and set the time start reference

Parameters:
formatDesired timestamp formatting

unsigned int  formatTime (char* buf, Formatting format = getFormatting())

formatTime

[static]

Fill a buffer with a current timestamp prefix

Parameters:
bufBuffer to fill, must be at least 24 characters long
formatDesired timestamp formatting

Returns: Length of the prefix written in buffer excluding final NUL


Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.