# DebugEnabler Class Reference

A holder for a debug level. More...

`#include <yateclass.h>`

Inheritance diagram for DebugEnabler:

List of all members.

## 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:

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

## Member Function Documentation

int debugLevel | ( |  | ) | const`[inline]`

Retrive the current local debug level

Returns:
  The current local debug level

int debugLevel | ( | int | level | ) |

Set the current local debug level.

Parameters:

  | level | The desired debug level

Returns:
  The new debug level (may be different)

bool debugEnabled | ( |  | ) | const`[inline]`

Retrive the current debug activation status

Returns:
  True if local debugging is enabled

void debugEnabled | ( | bool | enable | ) | `[inline]`

Set the current debug activation status

Parameters:

  | enable | The new debug activation status, true to enable

const char* debugName | ( |  | ) | const`[inline]`

Get the current debug name

Returns:
  Name of the debug activation if set or NULL

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

bool debugChained | ( |  | ) | const`[inline]`

Check if this enabler is chained to another one

Returns:
  True if local debugging is chained to other enabler

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

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

void debugName | ( | const char * | name | ) | `[inline, protected]`

Set the current debug name

Parameters:

  | name | Static debug name or NULL

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

- yateclass.h