#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 () |
Public Member Functions inherited from log4cpp::Category | |
void | alert (const char *stringFormat,...) throw () |
void | alert (const std::string &message) throw () |
CategoryStream | alertStream () throw () |
void | crit (const char *stringFormat,...) throw () |
void | crit (const std::string &message) throw () |
CategoryStream | critStream () |
void | debug (const char *stringFormat,...) throw () |
void | debug (const std::string &message) throw () |
CategoryStream | debugStream () |
void | emerg (const char *stringFormat,...) throw () |
void | emerg (const std::string &message) throw () |
CategoryStream | emergStream () |
void | error (const char *stringFormat,...) throw () |
void | error (const std::string &message) throw () |
CategoryStream | errorStream () |
void | fatal (const char *stringFormat,...) throw () |
void | fatal (const std::string &message) throw () |
CategoryStream | fatalStream () |
virtual const std::string & | getName () const throw () |
virtual Category * | getParent () throw () |
virtual const Category * | getParent () const throw () |
virtual CategoryStream | getStream (Priority::Value priority) |
void | info (const char *stringFormat,...) throw () |
void | info (const std::string &message) throw () |
CategoryStream | infoStream () |
bool | isAlertEnabled () const throw () |
bool | isCritEnabled () const throw () |
bool | isDebugEnabled () const throw () |
bool | isEmergEnabled () const throw () |
bool | isErrorEnabled () const throw () |
bool | isFatalEnabled () const throw () |
bool | isInfoEnabled () const throw () |
bool | isNoticeEnabled () const throw () |
virtual bool | isPriorityEnabled (Priority::Value priority) const throw () |
bool | isWarnEnabled () const throw () |
virtual void | log (Priority::Value priority, const char *stringFormat,...) throw () |
virtual void | log (Priority::Value priority, const std::string &message) throw () |
virtual void | logva (Priority::Value priority, const char *stringFormat, va_list va) throw () |
void | notice (const char *stringFormat,...) throw () |
void | notice (const std::string &message) throw () |
CategoryStream | noticeStream () |
virtual CategoryStream | operator<< (Priority::Value priority) |
virtual void | removeAppender (Appender *appender) |
void | setAppender (Appender *appender) |
void | setAppender (Appender &appender) |
virtual void | setPriority (Priority::Value priority) throw (std::invalid_argument) |
void | warn (const char *stringFormat,...) throw () |
void | warn (const std::string &message) throw () |
CategoryStream | warnStream () |
virtual | ~Category () |
Protected Member Functions | |
virtual void | _logUnconditionally2 (Priority::Value priority, const std::string &message) throw () |
Protected Member Functions inherited from log4cpp::Category | |
virtual void | _logUnconditionally (Priority::Value priority, const char *format, va_list arguments) throw () |
Category (const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET) | |
Private Attributes | |
std::string | _context |
Category & | _delegate |
Additional Inherited Members | |
Static Public Member Functions inherited from log4cpp::Category | |
static Category * | exists (const std::string &name) |
static std::vector< Category * > * | getCurrentCategories () |
static Category & | getInstance (const std::string &name) |
static Category & | getRoot () |
static Priority::Value | getRootPriority () throw () |
static void | setRootPriority (Priority::Value priority) |
static void | shutdown () |
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.
log4cpp::FixedContextCategory::FixedContextCategory | ( | const std::string & | name, |
const std::string & | context = "" |
||
) |
Constructor
name | the fully qualified name of this Categories delegate Category. |
context | the context to fill the NDC field of LoggingEvents with. |
Definition at line 15 of file FixedContextCategory.cpp.
|
virtual |
Destructor for Category.
Definition at line 22 of file FixedContextCategory.cpp.
|
protectedvirtual |
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 log4cpp::Category.
Definition at line 93 of file FixedContextCategory.cpp.
|
virtual |
For the moment this method does nothing.
Reimplemented from log4cpp::Category.
Definition at line 47 of file FixedContextCategory.cpp.
|
virtual |
For the moment this method does nothing.
Reimplemented from log4cpp::Category.
Definition at line 51 of file FixedContextCategory.cpp.
|
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 log4cpp::Category.
Definition at line 80 of file FixedContextCategory.cpp.
|
virtual |
Returns the additivity flag for this Category instance.
Reimplemented from log4cpp::Category.
Definition at line 89 of file FixedContextCategory.cpp.
|
virtual |
Returns the set of Appenders currently attached to this Catogory.
Reimplemented from log4cpp::Category.
Definition at line 64 of file FixedContextCategory.cpp.
|
virtual |
Returns the Appender for this Category, or NULL if no Appender has been set.
Reimplemented from log4cpp::Category.
Definition at line 55 of file FixedContextCategory.cpp.
|
virtual |
Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category.
Reimplemented from log4cpp::Category.
Definition at line 59 of file FixedContextCategory.cpp.
|
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 from log4cpp::Category.
Definition at line 37 of file FixedContextCategory.cpp.
|
virtual |
Return the context string used as NDC.
Definition at line 29 of file FixedContextCategory.cpp.
|
virtual |
Returns the assigned Priority, if any, for this Category.
Reimplemented from log4cpp::Category.
Definition at line 33 of file FixedContextCategory.cpp.
|
virtual |
FixedContextAppenders cannot own Appenders.
Reimplemented from log4cpp::Category.
Definition at line 72 of file FixedContextCategory.cpp.
|
virtual |
FixedContextAppenders cannot own Appenders.
Reimplemented from log4cpp::Category.
Definition at line 76 of file FixedContextCategory.cpp.
|
virtual |
Removes all appenders set for this Category. Currently a Category can have only one appender, but this may change in the future.
Reimplemented from log4cpp::Category.
Definition at line 68 of file FixedContextCategory.cpp.
|
virtual |
Set the additivity flag for this Category instance.
Reimplemented from log4cpp::Category.
Definition at line 85 of file FixedContextCategory.cpp.
|
virtual |
Set the context string used as NDC.
context | the context string |
Definition at line 25 of file FixedContextCategory.cpp.
|
private |
The context of this FixedContextCategory.
Definition at line 169 of file FixedContextCategory.hh.
|
private |
The delegate category of this FixedContextCategory.
Definition at line 166 of file FixedContextCategory.hh.