---
name: "log4tango::AppenderAttachable"
section: "3"
platform: "linux"
package: "liblog4tango-doc"
version: "9.3.4+dfsg1-2+deb12u1"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/log4tango::AppenderAttachable"
---

# log4tango::AppenderAttachable(3)

## NAME

log4tango::AppenderAttachable

## SYNOPSIS

`#include <AppenderAttachable.hh>`

Inherited by **log4tango::Logger**.

### Public Member Functions

**AppenderAttachable** ()\
 Constructor.  virtual **~AppenderAttachable** ()\
 Destructor.  void **add\_appender** (**Appender** \*appender)\
 Adds an **Appender**.  **AppenderList** **get\_all\_appenders** (void)\
 Get all previously added appenders as a vector.  **Appender** \* **get\_appender** (const std::string &name)\
 Get an appender by name.  bool **is\_attached** (**Appender** \*appender)\
 Returns true if the specified appender is in list of attached appanders, false otherwise.  void **remove\_all\_appenders** ()\
 Removes all appenders for this **Logger**.  void **remove\_appender** (**Appender** \*appender)\
 Remove the appender passed as parameter from the list of appenders.  void **remove\_appender** (const std::string &name)\
 Remove the appender with the name passed as parameter from the list of appenders.

### Protected Member Functions

**AppenderAttachable** (const **AppenderAttachable** &other)\
 **AppenderAttachable** & **operator=** (const **AppenderAttachable** &other)\

### Protected Attributes

**AppenderMap** **\_appenders**\
 Appenders repository.  **threading::Mutex** **\_appendersMutex**\
 A mutex to protect the repository against race conditions.

## Constructor & Destructor Documentation

### log4tango::AppenderAttachable::AppenderAttachable ()

Constructor.

### log4tango::AppenderAttachable::~AppenderAttachable ()` [virtual]`

Destructor.

### log4tango::AppenderAttachable::AppenderAttachable (const AppenderAttachable & other)` [protected]`

## Member Function Documentation

### void log4tango::AppenderAttachable::add\_appender (Appender \* appender)

Adds an **Appender**. Does nothing if the appender is NULL or already attached.

### AppenderList log4tango::AppenderAttachable::get\_all\_appenders (void)

Get all previously added appenders as a vector. The caller must call 'release' on each **Appender** in the returned list when it is no longer needed (the **Appender** class is ref-counted).

### Appender \* log4tango::AppenderAttachable::get\_appender (const std::string & name)

Get an appender by name. The caller must call 'release' on the returned **Appender** when it is no longer needed (the **Appender** class is ref-counted). Returns 0 if there is no **Appender** named 'name' currently attached.

### bool log4tango::AppenderAttachable::is\_attached (Appender \* appender)

Returns true if the specified appender is in list of attached appanders, false otherwise.

### AppenderAttachable & log4tango::AppenderAttachable::operator= (const AppenderAttachable & other)` [protected]`

### void log4tango::AppenderAttachable::remove\_all\_appenders (void)

Removes all appenders for this **Logger**.

### void log4tango::AppenderAttachable::remove\_appender (Appender \* appender)

Remove the appender passed as parameter from the list of appenders.

### void log4tango::AppenderAttachable::remove\_appender (const std::string & name)

Remove the appender with the name passed as parameter from the list of appenders.

## Member Data Documentation

### AppenderMap log4tango::AppenderAttachable::\_appenders` [protected]`

Appenders repository.

### threading::Mutex log4tango::AppenderAttachable::\_appendersMutex` [protected]`

A mutex to protect the repository against race conditions.

## Author

Generated automatically by Doxygen for log4tango from the source code.
