debug::Debug Class Reference

Debug class for handling debug information. More...

#include <Debug.h>

List of all members.

Public Member Functions

 Debug ()
 Debug class default constructor.
virtual ~Debug ()
 Debug class default destructor.
void SetVerbosity (string verbositystr)
 Set system verbosity.
string GetVerbosity ()
 Obtain debug system verbosity value.
void Prntdbg (const char *file, int line, const char *function, int verb, string print)
 Print debug information to standard output or a file.
void Prnterr (const char *file, int line, const char *function, string print)
 Print error information to standard error.
void SetDebug (bool debug, bool debugcode)
void StopDebug ()
 Stop debugging.
void StartDebug ()
 Start debugging.
bool isDebugging ()
 Obtain if we are debugging or not.

Private Attributes

int verbosity
 Debug system verbosity.
bool debug bool debugcode
 Display debug information or not.


Detailed Description

Debug class for handling debug information.

Debug class handles all debugging information and displays output on the screen while running in non-background mode with CLI (Command Line Interface) access

Warning:
All clases must have the same debugger instance
Todo:
Try to apply a thread-safe singleton design pattern?

Definition at line 33 of file Debug.h.


Constructor & Destructor Documentation

debug::Debug::Debug (  ) 

Debug class default constructor.

Definition at line 14 of file Debug.cc.

References verbosity.

debug::Debug::~Debug (  )  [virtual]

Debug class default destructor.

Definition at line 82 of file Debug.cc.


Member Function Documentation

string debug::Debug::GetVerbosity (  ) 

Obtain debug system verbosity value.

Return values:
string string containing system verbosity value

Definition at line 52 of file Debug.cc.

References verbosity.

Referenced by main().

bool debug::Debug::isDebugging (  ) 

Obtain if we are debugging or not.

Return values:
true we are debugging
false we are not debugging

Definition at line 77 of file Debug.cc.

void debug::Debug::Prntdbg ( const char *  file,
int  line,
const char *  function,
int  verb,
string  print 
)

Print debug information to standard output or a file.

This method prints coloured debug information to standard output or a log file (depending on user selection). It also provides tracing of code files, lines and functions. For such task we are providing CODEAT define that provides all needed MACROS for processing this information.

Warning:
Be sure to include generic.h in all voiphoney classes
Parameters:
file string containing source file name
line string containing line number
function string containing function name
verb minimum verbosity level for displaying this message
print string contaning debug message content

Referenced by main().

void debug::Debug::Prnterr ( const char *  file,
int  line,
const char *  function,
string  print 
)

Print error information to standard error.

This method prints debug information to standard error and / or a log file (depending on user selection). It also provides tracing of code files, lines and functions. For such task we are providing CODEAT define that provides all needed MACROS for processing this information.

Warning:
Be sure to include generic.h in all voiphoney classes
Parameters:
file string containing source file name
line string containing line number
function string containing function name
print string contaning debug message content

Referenced by main().

void debug::Debug::SetDebug ( bool  debug,
bool  debugcode 
)

Definition at line 59 of file Debug.cc.

Referenced by main().

void debug::Debug::SetVerbosity ( string  verbositystr  ) 

Set system verbosity.

Adjust system verbosity, when verbosity value is higher voiphoney debug system will display more debug information

Parameters:
verbositystr String containing a integer verbosity value

Referenced by main().

void debug::Debug::StartDebug (  ) 

Start debugging.

Definition at line 71 of file Debug.cc.

void debug::Debug::StopDebug (  ) 

Stop debugging.

Definition at line 65 of file Debug.cc.


Member Data Documentation

bool debug bool debug::Debug::debugcode [private]

Display debug information or not.

Display code debug information or not

Definition at line 108 of file Debug.h.

int debug::Debug::verbosity [private]

Debug system verbosity.

Definition at line 104 of file Debug.h.

Referenced by Debug(), and GetVerbosity().


The documentation for this class was generated from the following files:

VoipHoney is proudly sponsored by OpenVoIP

This documentation has been generated using doxygen 1.5.8