Yate
Public Member Functions | Protected Member Functions | List of all members
DebugEnabler Class Reference

A holder for a debug level. More...

#include <yateclass.h>

Inheritance diagram for DebugEnabler:
Channel Plugin XmlSaxParser ClientChannel Module XmlDomParser Driver ClientDriver

Public Member Functions

 DebugEnabler (int level=TelEngine::debugLevel(), bool enabled=true)
 
int debugLevel () const
 
int debugLevel (int level)
 
bool debugEnabled () const
 
void debugEnabled (bool enable)
 
const char * debugName () const
 
bool debugAt (int level) const
 
bool debugChained () const
 
void debugChain (const DebugEnabler *chain=0)
 
void debugCopy (const DebugEnabler *original=0)
 

Protected Member Functions

void debugName (const char *name)
 

Detailed Description

A holder for a debug level.

Holds a local debugging level that can be modified separately from the global debugging

Constructor & Destructor Documentation

DebugEnabler ( int  level = TelEngine::debugLevel(),
bool  enabled = true 
)
inline

Constructor

Parameters
levelThe initial local debug level
enabledEnable debugging on this object

References DebugEnabler::debugLevel().

Member Function Documentation

bool debugAt ( int  level) const

Check if debugging output should be generated

Parameters
levelThe debug level we are testing
Returns
True if messages should be output, false otherwise
void debugChain ( const DebugEnabler chain = 0)
inline

Chain this debug holder to a parent or detach from existing one

Parameters
chainPointer to parent debug level, NULL to detach
bool debugChained ( ) const
inline

Check if this enabler is chained to another one

Returns
True if local debugging is chained to other enabler
void debugCopy ( const DebugEnabler original = 0)

Copy debug settings from another object or from engine globals

Parameters
originalPointer to a DebugEnabler to copy settings from
bool debugEnabled ( ) const
inline

Retrieve the current debug activation status

Returns
True if local debugging is enabled

References DebugEnabler::debugEnabled().

Referenced by DebugEnabler::debugEnabled().

void debugEnabled ( bool  enable)
inline

Set the current debug activation status

Parameters
enableThe new debug activation status, true to enable
int debugLevel ( ) const
inline

Retrieve the current local debug level

Returns
The current local debug level

References DebugEnabler::debugLevel().

Referenced by DebugEnabler::DebugEnabler(), and DebugEnabler::debugLevel().

int debugLevel ( int  level)

Set the current local debug level.

Parameters
levelThe desired debug level
Returns
The new debug level (may be different)
const char* debugName ( ) const
inline

Get the current debug name

Returns
Name of the debug activation if set or NULL
void debugName ( const char *  name)
inlineprotected

Set the current debug name

Parameters
nameStatic debug name or NULL

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