Yate: DebugEnabler Class Reference

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:

## 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)
void | debugSet (const char *desc)

## 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()

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

Constructor

Parameters

  level | The initial local debug level
  enabled | Enable debugging on this object

References debugLevel().

Referenced by debugChain(), and debugCopy().

## Member Function Documentation

## ◆ debugAt()

bool debugAt | ( | int | level | ) | const

Check if debugging output should be generated

Parameters

  level | The debug level we are testing

Returns
  True if messages should be output, false otherwise

## ◆ debugChain()

void debugChain | ( | const DebugEnabler * | chain = 0 | ) |
| inline

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

Parameters

  chain | Pointer to parent debug level, NULL to detach

References DebugEnabler().

## ◆ debugChained()

bool debugChained | ( |  | ) | const
| inline

Check if this enabler is chained to another one

Returns
  True if local debugging is chained to other enabler

## ◆ debugCopy()

void debugCopy | ( | const DebugEnabler * | original = 0 | ) |

Copy debug settings from another object or from engine globals

Parameters

  original | Pointer to a DebugEnabler to copy settings from

References DebugEnabler().

## ◆ debugEnabled() [1/2]

bool debugEnabled | ( |  | ) | const
| inline

Retrieve the current debug activation status

Returns
  True if local debugging is enabled

## ◆ debugEnabled() [2/2]

void debugEnabled | ( | bool | enable | ) |
| inline

Set the current debug activation status

Parameters

  enable | The new debug activation status, true to enable

## ◆ debugLevel() [1/2]

int debugLevel | ( |  | ) | const
| inline

Retrieve the current local debug level

Returns
  The current local debug level

Referenced by DebugEnabler().

## ◆ debugLevel() [2/2]

int debugLevel | ( | int | level | ) |

Set the current local debug level.

Parameters

  level | The desired debug level

Returns
  The new debug level (may be different)

## ◆ debugName() [1/2]

const char * debugName | ( |  | ) | const
| inline

Get the current debug name

Returns
  Name of the debug activation if set or NULL

## ◆ debugName() [2/2]

void debugName | ( | const char * | name | ) |
| inlineprotected

Set the current debug name

Parameters

  name | Static debug name or NULL

## ◆ debugSet()

void debugSet | ( | const char * | desc | ) |

Set debug from description

Parameters

  desc | Debug description. [level [NNN][+-]] or 'reset'

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

- yateclass.h