#include <FixedContextCategory.hh>
Public Member Functions | |
virtual void | addAppender (Appender *appender) throw () |
virtual void | addAppender (Appender &appender) |
virtual void | callAppenders (const LoggingEvent &event) throw () |
FixedContextCategory (const std::string &name, const std::string &context="") | |
virtual bool | getAdditivity () const throw () |
virtual AppenderSet | getAllAppenders () const |
virtual Appender * | getAppender () const |
virtual Appender * | getAppender (const std::string &name) const |
virtual Priority::Value | getChainedPriority () const throw () |
virtual std::string | getContext () const |
virtual Priority::Value | getPriority () const throw () |
virtual bool | ownsAppender () const throw () |
virtual bool | ownsAppender (Appender *appender) const throw () |
virtual void | removeAllAppenders () |
virtual void | setAdditivity (bool additivity) |
virtual void | setContext (const std::string &context) |
virtual | ~FixedContextCategory () |
Protected Member Functions | |
virtual void | _logUnconditionally2 (Priority::Value priority, const std::string &message) throw () |
Private Attributes | |
std::string | _context |
Category & | _delegate |
This Category subclass replaces the NDC field in LoggingEvents with a fixed context string. All handling of Appenders, etc. is delgated to the 'normal' Category with the same name. Its intended use is for object instances that serve a single client: they contruct a FixedContextCategory with the client identifier as context. Unlike with regular Category instances one has to explicitly create FixedContextCategory instances using the constructor. This also implies one has to take cake of destruction of the instance as well.
Definition at line 29 of file FixedContextCategory.hh.
FixedContextCategory::FixedContextCategory | ( | const std::string & | name, |
const std::string & | context = "" |
||
) |
virtual FixedContextCategory::~FixedContextCategory | ( | ) | [virtual] |
Destructor for Category.
virtual void FixedContextCategory::_logUnconditionally2 | ( | Priority::Value | priority, |
const std::string & | message | ||
) | throw () [protected, virtual] |
Unconditionally log a message with the specified priority.
priority | The priority of this log message. |
message | string to write in the log file |
Reimplemented from Category.
virtual void FixedContextCategory::addAppender | ( | Appender * | appender | ) | throw () [virtual] |
For the moment this method does nothing.
Reimplemented from Category.
virtual void FixedContextCategory::addAppender | ( | Appender & | appender | ) | [virtual] |
For the moment this method does nothing.
Reimplemented from Category.
virtual void FixedContextCategory::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.
event | The LoggingEvent to log. |
Reimplemented from Category.
virtual bool FixedContextCategory::getAdditivity | ( | ) | const throw () [virtual] |
virtual AppenderSet FixedContextCategory::getAllAppenders | ( | ) | const [virtual] |
Returns the set of Appenders currently attached to this Catogory.
Reimplemented from Category.
virtual Appender* FixedContextCategory::getAppender | ( | ) | const [virtual] |
virtual Appender* FixedContextCategory::getAppender | ( | const std::string & | name | ) | const [virtual] |
virtual Priority::Value FixedContextCategory::getChainedPriority | ( | ) | const throw () [virtual] |
virtual std::string FixedContextCategory::getContext | ( | ) | const [virtual] |
Return the context string used as NDC.
virtual Priority::Value FixedContextCategory::getPriority | ( | ) | const throw () [virtual] |
virtual bool FixedContextCategory::ownsAppender | ( | ) | const throw () [virtual] |
virtual bool FixedContextCategory::ownsAppender | ( | Appender * | appender | ) | const throw () [virtual] |
virtual void FixedContextCategory::removeAllAppenders | ( | ) | [virtual] |
virtual void FixedContextCategory::setAdditivity | ( | bool | additivity | ) | [virtual] |
virtual void FixedContextCategory::setContext | ( | const std::string & | context | ) | [virtual] |
Set the context string used as NDC.
context | the context string |
std::string FixedContextCategory::_context [private] |
The context of this FixedContextCategory.
Definition at line 169 of file FixedContextCategory.hh.
Category& FixedContextCategory::_delegate [private] |
The delegate category of this FixedContextCategory.
Definition at line 166 of file FixedContextCategory.hh.