log4shib 2.0.0

Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
log4shib::Category Class Reference

This is the central class in the log4j package. More...

`#include <Category.hh>`

Inheritance diagram for log4shib::Category:
[legend]

## Public Member Functions
virtual | ~Category ()
| Destructor for Category. More...
virtual const std::string & | getName () const throw ()
| Return the category name. More...
virtual void | setPriority (Priority::Value priority) throw (std::invalid_argument)
| Set the priority of this Category. More...
virtual Priority::Value | getPriority () const throw ()
| Returns the assigned Priority, if any, for this Category. More...
virtual Priority::Value | getChainedPriority () const throw ()
| Starting from this Category, search the category hierarchy for a set priority and return it. More...
virtual bool | isPriorityEnabled (Priority::Value priority) const throw ()
| Returns true if the chained priority of the Category is equal to or higher than given priority. More...
virtual void | addAppender (Appender *appender) throw (std::invalid_argument)
| Adds an Appender to this Category. More...
virtual void | addAppender (Appender &appender)
| Adds an Appender for this Category. More...
void | setAppender (Appender *appender)
| Adds an Appender to this Category. More...
void | setAppender (Appender &appender)
| Adds an Appender for this Category. More...
virtual Appender * | getAppender () const
| Returns the first Appender for this Category, or NULL if no Appender has been set. More...
virtual Appender * | getAppender (const std::string &name) const
| Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category. More...
virtual AppenderSet | getAllAppenders () const
| Returns the set of Appenders currently attached to this Catogory. More...
virtual void | removeAllAppenders ()
| Removes all appenders for this Category. More...
virtual void | removeAppender (Appender *appender)
| Removes specified appender for this Category. More...
bool | ownsAppender () const throw ()
| Returns true if the Category owns the first Appender in its Appender set. More...
virtual bool | ownsAppender (Appender *appender) const throw ()
| Returns true if the Category owns the Appender. More...
virtual void | callAppenders (const LoggingEvent &event) throw ()
| Call the appenders in the hierarchy starting at `this`. More...
virtual void | setAdditivity (bool additivity)
| Set the additivity flag for this Category instance. More...
virtual bool | getAdditivity () const throw ()
| Returns the additivity flag for this Category instance. More...
virtual Category * | getParent () throw ()
| Returns the parent category of this category, or NULL if the category is the root category. More...
virtual const Category * | getParent () const throw ()
| Returns the parent category of this category, or NULL if the category is the root category. More...
virtual void | log (Priority::Value priority, const char *stringFormat,...) throw ()
| Log a message with the specified priority. More...
virtual void | log (Priority::Value priority, const std::string &message) throw ()
| Log a message with the specified priority. More...
virtual void | logva (Priority::Value priority, const char *stringFormat, va_list va) throw ()
| Log a message with the specified priority. More...
void | debug (const char *stringFormat,...) throw ()
| Log a message with debug priority. More...
void | debug (const std::string &message) throw ()
| Log a message with debug priority. More...
bool | isDebugEnabled () const throw ()
| Return true if the Category will log messages with priority DEBUG. More...
CategoryStream | debugStream ()
| Return a CategoryStream with priority DEBUG. More...
void | info (const char *stringFormat,...) throw ()
| Log a message with info priority. More...
void | info (const std::string &message) throw ()
| Log a message with info priority. More...
bool | isInfoEnabled () const throw ()
| Return true if the Category will log messages with priority INFO. More...
CategoryStream | infoStream ()
| Return a CategoryStream with priority INFO. More...
void | notice (const char *stringFormat,...) throw ()
| Log a message with notice priority. More...
void | notice (const std::string &message) throw ()
| Log a message with notice priority. More...
bool | isNoticeEnabled () const throw ()
| Return true if the Category will log messages with priority NOTICE. More...
CategoryStream | noticeStream ()
| Return a CategoryStream with priority NOTICE. More...
void | warn (const char *stringFormat,...) throw ()
| Log a message with warn priority. More...
void | warn (const std::string &message) throw ()
| Log a message with warn priority. More...
bool | isWarnEnabled () const throw ()
| Return true if the Category will log messages with priority WARN. More...
CategoryStream | warnStream ()
| Return a CategoryStream with priority WARN. More...
void | error (const char *stringFormat,...) throw ()
| Log a message with error priority. More...
void | error (const std::string &message) throw ()
| Log a message with error priority. More...
bool | isErrorEnabled () const throw ()
| Return true if the Category will log messages with priority ERROR. More...
CategoryStream | errorStream ()
| Return a CategoryStream with priority ERROR. More...
void | crit (const char *stringFormat,...) throw ()
| Log a message with crit priority. More...
void | crit (const std::string &message) throw ()
| Log a message with crit priority. More...
bool | isCritEnabled () const throw ()
| Return true if the Category will log messages with priority CRIT. More...
CategoryStream | critStream ()
| Return a CategoryStream with priority CRIT. More...
void | alert (const char *stringFormat,...) throw ()
| Log a message with alert priority. More...
void | alert (const std::string &message) throw ()
| Log a message with alert priority. More...
bool | isAlertEnabled () const throw ()
| Return true if the Category will log messages with priority ALERT. More...
CategoryStream | alertStream () throw ()
| Return a CategoryStream with priority ALERT. More...
void | emerg (const char *stringFormat,...) throw ()
| Log a message with emerg priority. More...
void | emerg (const std::string &message) throw ()
| Log a message with emerg priority. More...
bool | isEmergEnabled () const throw ()
| Return true if the Category will log messages with priority EMERG. More...
CategoryStream | emergStream ()
| Return a CategoryStream with priority EMERG. More...
void | fatal (const char *stringFormat,...) throw ()
| Log a message with fatal priority. More...
void | fatal (const std::string &message) throw ()
| Log a message with fatal priority. More...
bool | isFatalEnabled () const throw ()
| Return true if the Category will log messages with priority FATAL. More...
CategoryStream | fatalStream ()
| Return a CategoryStream with priority FATAL. More...
virtual CategoryStream | getStream (Priority::Value priority)
| Return a CategoryStream with given Priority. More...
virtual CategoryStream | operator<< (Priority::Value priority)
| Return a CategoryStream with given Priority. More...

## Static Public Member Functions
static Category & | getRoot ()
| Return the root of the Category hierarchy. More...
static void | setRootPriority (Priority::Value priority)
| Set the priority of the root Category. More...
static Priority::Value | getRootPriority () throw ()
| Get the priority of the `root` Category. More...
static Category & | getInstance (const std::string &name)
| Instantiate a Category with name `name`. More...
static Category * | exists (const std::string &name)
| If the named category exists (in the default hierarchy) then it returns a reference to the category, otherwise it returns NULL. More...
static std::vector< Category * > * | getCurrentCategories ()
| Returns all the currently defined categories as a vector of Category pointers. More...
static void | shutdown ()
| This method will remove all Appenders from Categories.XXX. More...

## Protected Member Functions
| Category (const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)
| Constructor. More...
virtual void | _logUnconditionally (Priority::Value priority, const char *format, va_list arguments) throw ()
virtual void | _logUnconditionally2 (Priority::Value priority, const std::string &message) throw ()
| Unconditionally log a message with the specified priority. More...

## Friends
class | HierarchyMaintainer

## Detailed Description

This is the central class in the log4j package.

One of the distintive features of log4j (and hence log4shib) are hierarchal categories and their evaluation.

## Constructor & Destructor Documentation

## ◆ ~Category()

log4shib::Category::~Category | ( |  | ) |
| virtual

Destructor for Category.

## ◆ Category()

log4shib::Category::Category | ( | const std::string & | name,
|  | Category * | parent,
|  | Priority::Value | priority = `Priority::NOTSET`
| ) |  |
| protected

Constructor.

Parameters

  name | the fully qualified name of this Category
  parent | the parent of this parent, or NULL for the root Category
  priority | the priority for this Category. Defaults to Priority::NOTSET

## Member Function Documentation

## ◆ _logUnconditionally()

void log4shib::Category::_logUnconditionally | ( | Priority::Value | priority,
|  | const char * | format,
|  | va_list | arguments
| ) |  |
throw | ( |
| ) |  |
| protected virtual

## ◆ _logUnconditionally2()

void log4shib::Category::_logUnconditionally2 | ( | Priority::Value | priority,
|  | const std::string & | message
| ) |  |
throw | ( |
| ) |  |
| protected virtual

Unconditionally log a message with the specified priority.

Parameters

  priority | The priority of this log message.
  message | string to write in the log file

Reimplemented in log4shib::FixedContextCategory.

## ◆ addAppender() [1/2]

void log4shib::Category::addAppender | ( | Appender & | appender | ) |
| virtual

Adds an Appender for this Category.

This method does not pass ownership from the caller to the Category.

Since
  0.2.7

Parameters

  appender | The Appender this category has to log to.

Reimplemented in log4shib::FixedContextCategory.

## ◆ addAppender() [2/2]

void log4shib::Category::addAppender | ( | Appender * | appender | ) |
throw | ( | std::invalid_argument
| ) |  |
| virtual

Adds an Appender to this Category.

This method passes ownership from the caller to the Category.

Since
  0.2.7

Parameters

  appender | The Appender to wich this category has to log.

Exceptions

  std::invalid_argument | if the appender is NULL.

Reimplemented in log4shib::FixedContextCategory.

## ◆ alert() [1/2]

void log4shib::Category::alert | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with alert priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ alert() [2/2]

void log4shib::Category::alert | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with alert priority.

Parameters

  message | string to write in the log file

## ◆ alertStream()

CategoryStream log4shib::Category::alertStream | ( |  | ) |
throw | ( |
| ) |  |
| inline

Return a CategoryStream with priority ALERT.

Returns
  The CategoryStream.

## ◆ callAppenders()

void log4shib::Category::callAppenders | ( | const LoggingEvent & | event | ) |
throw | ( |
| ) |  |
| virtual

Call the appenders in the hierarchy starting at `this`.

If no appenders could be found, emit a warning.

This method always calls all the appenders inherited form the hierracy circumventing any evaluation of whether to log or not to log the particular log request.

Parameters

  event | the LogginEvent to log.

Reimplemented in log4shib::FixedContextCategory.

## ◆ crit() [1/2]

void log4shib::Category::crit | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with crit priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ crit() [2/2]

void log4shib::Category::crit | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with crit priority.

Parameters

  message | string to write in the log file

## ◆ critStream()

CategoryStream log4shib::Category::critStream | ( |  | ) |
| inline

Return a CategoryStream with priority CRIT.

Returns
  The CategoryStream.

## ◆ debug() [1/2]

void log4shib::Category::debug | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with debug priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ debug() [2/2]

void log4shib::Category::debug | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with debug priority.

Parameters

  message | string to write in the log file

## ◆ debugStream()

CategoryStream log4shib::Category::debugStream | ( |  | ) |
| inline

Return a CategoryStream with priority DEBUG.

Returns
  The CategoryStream.

## ◆ emerg() [1/2]

void log4shib::Category::emerg | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with emerg priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ emerg() [2/2]

void log4shib::Category::emerg | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with emerg priority.

Parameters

  message | string to write in the log file

## ◆ emergStream()

CategoryStream log4shib::Category::emergStream | ( |  | ) |
| inline

Return a CategoryStream with priority EMERG.

Returns
  The CategoryStream.

## ◆ error() [1/2]

void log4shib::Category::error | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with error priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ error() [2/2]

void log4shib::Category::error | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with error priority.

Parameters

  message | string to write in the log file

## ◆ errorStream()

CategoryStream log4shib::Category::errorStream | ( |  | ) |
| inline

Return a CategoryStream with priority ERROR.

Returns
  The CategoryStream.

## ◆ exists()

Category * log4shib::Category::exists | ( | const std::string & | name | ) |
| static

If the named category exists (in the default hierarchy) then it returns a reference to the category, otherwise it returns NULL.

Since
  0.2.7

## ◆ fatal() [1/2]

void log4shib::Category::fatal | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with fatal priority.

NB. priority 'fatal' is equivalent to 'emerg'.

Since
  0.2.7

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ fatal() [2/2]

void log4shib::Category::fatal | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with fatal priority.

NB. priority 'fatal' is equivalent to 'emerg'.

Since
  0.2.7

Parameters

  message | string to write in the log file

## ◆ fatalStream()

CategoryStream log4shib::Category::fatalStream | ( |  | ) |
| inline

Return a CategoryStream with priority FATAL.

NB. priority 'fatal' is equivalent to 'emerg'.

Since
  0.2.7

Returns
  The CategoryStream.

## ◆ getAdditivity()

bool log4shib::Category::getAdditivity | ( |  | ) | const
throw | ( |
| ) |  |
| virtual

Returns the additivity flag for this Category instance.

Reimplemented in log4shib::FixedContextCategory.

## ◆ getAllAppenders()

AppenderSet log4shib::Category::getAllAppenders | ( |  | ) | const
| virtual

Returns the set of Appenders currently attached to this Catogory.

Since
  0.3.1

Returns
  The set of attached Appenders.

Reimplemented in log4shib::FixedContextCategory.

## ◆ getAppender() [1/2]

Appender * log4shib::Category::getAppender | ( |  | ) | const
| virtual

Returns the first Appender for this Category, or NULL if no Appender has been set.

Deprecated:
  use getAppender(const std::string&)

Returns
  The Appender.

Reimplemented in log4shib::FixedContextCategory.

## ◆ getAppender() [2/2]

Appender * log4shib::Category::getAppender | ( | const std::string & | name | ) | const
| virtual

Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category.

Since
  0.2.7

Returns
  The Appender.

Reimplemented in log4shib::FixedContextCategory.

## ◆ getChainedPriority()

Priority::Value log4shib::Category::getChainedPriority | ( |  | ) | const
throw | ( |
| ) |  |
| virtual

Starting from this Category, search the category hierarchy for a set priority and return it.

Otherwise, return the priority of the root category.

The Category class is designed so that this method executes as quickly as possible.

Reimplemented in log4shib::FixedContextCategory.

## ◆ getCurrentCategories()

std::vector< Category * > * log4shib::Category::getCurrentCategories | ( |  | ) |
| static

Returns all the currently defined categories as a vector of Category pointers.

Note: this function does not pass ownership of the categories in the vector to the caller, only the ownership of the vector. However vector<Category&>* is not legal C++, so we can't follow the default ownership conventions.

Unlike in log4j, the root category is included in the returned set.

Since
  0.3.2. Before 0.3.2 this method returned a std::set

## ◆ getInstance()

Category & log4shib::Category::getInstance | ( | const std::string & | name | ) |
| static

Instantiate a Category with name `name`.

This method does not set priority of the category which is by default `Priority::NOTSET`.

Parameters

  name | The name of the category to retrieve.

## ◆ getName()

const std::string & log4shib::Category::getName | ( |  | ) | const
throw | ( |
| ) |  |
| virtual

Return the category name.

Returns
  The category name.

## ◆ getParent() [1/2]

Category * log4shib::Category::getParent | ( |  | ) |
throw | ( |
| ) |  |
| virtual

Returns the parent category of this category, or NULL if the category is the root category.

Returns
  the parent category.

## ◆ getParent() [2/2]

const Category * log4shib::Category::getParent | ( |  | ) | const
throw | ( |
| ) |  |
| virtual

Returns the parent category of this category, or NULL if the category is the root category.

Returns
  the parent category.

## ◆ getPriority()

Priority::Value log4shib::Category::getPriority | ( |  | ) | const
throw | ( |
| ) |  |
| virtual

Returns the assigned Priority, if any, for this Category.

Returns
  Priority - the assigned Priority, can be Priority::NOTSET

Reimplemented in log4shib::FixedContextCategory.

## ◆ getRoot()

Category & log4shib::Category::getRoot | ( |  | ) |
| static

Return the root of the Category hierarchy.

The root category is always instantiated and available. It's name is the empty string.

Unlike in log4j, calling `Category.getInstance("")` does retrieve the root category and not a category just under root named "".

Returns
  The root category

## ◆ getRootPriority()

Priority::Value log4shib::Category::getRootPriority | ( |  | ) |
throw | ( |
| ) |  |
| static

Get the priority of the `root` Category.

Returns
  the priority of the root category

## ◆ getStream()

CategoryStream log4shib::Category::getStream | ( | Priority::Value | priority | ) |
| virtual

Return a CategoryStream with given Priority.

Parameters

  priority | The Priority of the CategoryStream.

Returns
  The requested CategoryStream.

## ◆ info() [1/2]

void log4shib::Category::info | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with info priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ info() [2/2]

void log4shib::Category::info | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with info priority.

Parameters

  message | string to write in the log file

## ◆ infoStream()

CategoryStream log4shib::Category::infoStream | ( |  | ) |
| inline

Return a CategoryStream with priority INFO.

Returns
  The CategoryStream.

## ◆ isAlertEnabled()

bool log4shib::Category::isAlertEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority ALERT.

Returns
  Whether the Category will log.

## ◆ isCritEnabled()

bool log4shib::Category::isCritEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority CRIT.

Returns
  Whether the Category will log.

## ◆ isDebugEnabled()

bool log4shib::Category::isDebugEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority DEBUG.

Returns
  Whether the Category will log.

## ◆ isEmergEnabled()

bool log4shib::Category::isEmergEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority EMERG.

Returns
  Whether the Category will log.

## ◆ isErrorEnabled()

bool log4shib::Category::isErrorEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority ERROR.

Returns
  Whether the Category will log.

## ◆ isFatalEnabled()

bool log4shib::Category::isFatalEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority FATAL.

NB. priority 'fatal' is equivalent to 'emerg'.

Since
  0.2.7

Returns
  Whether the Category will log.

## ◆ isInfoEnabled()

bool log4shib::Category::isInfoEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority INFO.

Returns
  Whether the Category will log.

## ◆ isNoticeEnabled()

bool log4shib::Category::isNoticeEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority NOTICE.

Returns
  Whether the Category will log.

## ◆ isPriorityEnabled()

bool log4shib::Category::isPriorityEnabled | ( | Priority::Value | priority | ) | const
throw | ( |
| ) |  |
| virtual

Returns true if the chained priority of the Category is equal to or higher than given priority.

Parameters

  priority | The priority to compare with.

Returns
  whether logging is enable for this priority.

## ◆ isWarnEnabled()

bool log4shib::Category::isWarnEnabled | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Return true if the Category will log messages with priority WARN.

Returns
  Whether the Category will log.

## ◆ log() [1/2]

void log4shib::Category::log | ( | Priority::Value | priority,
|  | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |
| virtual

Log a message with the specified priority.

Parameters

  priority | The priority of this log message.
  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ log() [2/2]

void log4shib::Category::log | ( | Priority::Value | priority,
|  | const std::string & | message
| ) |  |
throw | ( |
| ) |  |
| virtual

Log a message with the specified priority.

Parameters

  priority | The priority of this log message.
  message | string to write in the log file

## ◆ logva()

void log4shib::Category::logva | ( | Priority::Value | priority,
|  | const char * | stringFormat,
|  | va_list | va
| ) |  |
throw | ( |
| ) |  |
| virtual

Log a message with the specified priority.

Since
  0.2.7

Parameters

  priority | The priority of this log message.
  stringFormat | Format specifier for the string to write in the log file.
  va | The arguments for stringFormat.

## ◆ notice() [1/2]

void log4shib::Category::notice | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with notice priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ notice() [2/2]

void log4shib::Category::notice | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with notice priority.

Parameters

  message | string to write in the log file

## ◆ noticeStream()

CategoryStream log4shib::Category::noticeStream | ( |  | ) |
| inline

Return a CategoryStream with priority NOTICE.

Returns
  The CategoryStream.

## ◆ operator<<()

CategoryStream log4shib::Category::operator<< | ( | Priority::Value | priority | ) |
| virtual

Return a CategoryStream with given Priority.

Parameters

  priority | The Priority of the CategoryStream.

Returns
  The requested CategoryStream.

## ◆ ownsAppender() [1/2]

bool log4shib::Category::ownsAppender | ( |  | ) | const
throw | ( |
| ) |  |
| inline

Returns true if the Category owns the first Appender in its Appender set.

In that case the Category destructor will delete the Appender.

Deprecated:
  use ownsAppender(Appender*)

## ◆ ownsAppender() [2/2]

bool log4shib::Category::ownsAppender | ( | Appender * | appender | ) | const
throw | ( |
| ) |  |
| virtual

Returns true if the Category owns the Appender.

In that case the Category destructor will delete the Appender.

Since
  0.2.7

Reimplemented in log4shib::FixedContextCategory.

## ◆ removeAllAppenders()

void log4shib::Category::removeAllAppenders | ( |  | ) |
| virtual

Removes all appenders for this Category.

Reimplemented in log4shib::FixedContextCategory.

## ◆ removeAppender()

void log4shib::Category::removeAppender | ( | Appender * | appender | ) |
| virtual

Removes specified appender for this Category.

Since
  0.2.7

## ◆ setAdditivity()

void log4shib::Category::setAdditivity | ( | bool | additivity | ) |
| virtual

Set the additivity flag for this Category instance.

Reimplemented in log4shib::FixedContextCategory.

## ◆ setAppender() [1/2]

void log4shib::Category::setAppender | ( | Appender & | appender | ) |
| inline

Adds an Appender for this Category.

This method does not pass ownership from the caller to the Category.

Deprecated:
  use addAppender(Appender&) instead.

Parameters

  appender | The Appender this category has to log to.

## ◆ setAppender() [2/2]

void log4shib::Category::setAppender | ( | Appender * | appender | ) |
| inline

Adds an Appender to this Category.

This method passes ownership from the caller to the Category.

Deprecated:
  use addAppender(Appender*) or removeAllAppenders() instead.

Parameters

  appender | The Appender this category has to log to or NULL to remove the current Appenders.

## ◆ setPriority()

void log4shib::Category::setPriority | ( | Priority::Value | priority | ) |
throw | ( | std::invalid_argument
| ) |  |
| virtual

Set the priority of this Category.

Parameters

  priority | The priority to set. Use Priority::NOTSET to let the category use its parents priority as effective priority.

Exceptions

  std::invalid_argument | if the caller tries to set Priority::NOTSET on the Root Category.

## ◆ setRootPriority()

void log4shib::Category::setRootPriority | ( | Priority::Value | priority | ) |
| static

Set the priority of the root Category.

Parameters

  priority | The new priority for the root Category

## ◆ shutdown()

void log4shib::Category::shutdown | ( |  | ) |
| static

This method will remove all Appenders from Categories.XXX.

## ◆ warn() [1/2]

void log4shib::Category::warn | ( | const char * | stringFormat,
|  |  | ...
| ) |  |
throw | ( |
| ) |  |

Log a message with warn priority.

Parameters

  stringFormat | Format specifier for the string to write in the log file.
  ... | The arguments for stringFormat

## ◆ warn() [2/2]

void log4shib::Category::warn | ( | const std::string & | message | ) |
throw | ( |
| ) |  |

Log a message with warn priority.

Parameters

  message | string to write in the log file

## ◆ warnStream()

CategoryStream log4shib::Category::warnStream | ( |  | ) |
| inline

Return a CategoryStream with priority WARN.

Returns
  The CategoryStream.

## Friends And Related Function Documentation

## ◆ HierarchyMaintainer

friend class HierarchyMaintainer
| friend

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

- Category.hh
- Category.cpp