log4cpp::FixedContextCategory Class Reference

#include <FixedContextCategory.hh>

Inheritance diagram for log4cpp::FixedContextCategory:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void addAppender (Appender &appender)
virtual void addAppender (Appender *appender) throw ()
virtual void addAppender (Appender &appender)
virtual void addAppender (Appender *appender) throw ()
virtual void callAppenders (const LoggingEvent &event) throw ()
virtual void callAppenders (const LoggingEvent &event) throw ()
 FixedContextCategory (const std::string &name, const std::string &context="")
 FixedContextCategory (const std::string &name, const std::string &context="")
virtual bool getAdditivity () const throw ()
virtual bool getAdditivity () const throw ()
virtual AppenderSet getAllAppenders () const
virtual AppenderSet getAllAppenders () const
virtual AppendergetAppender (const std::string &name) const
virtual AppendergetAppender () const
virtual AppendergetAppender (const std::string &name) const
virtual AppendergetAppender () const
virtual Priority::Value getChainedPriority () const throw ()
virtual Priority::Value getChainedPriority () const throw ()
virtual std::string getContext () const
virtual std::string getContext () const
virtual Priority::Value getPriority () const throw ()
virtual Priority::Value getPriority () const throw ()
virtual bool ownsAppender (Appender *appender) const throw ()
virtual bool ownsAppender () const throw ()
virtual bool ownsAppender (Appender *appender) const throw ()
virtual bool ownsAppender () const throw ()
virtual void removeAllAppenders ()
virtual void removeAllAppenders ()
virtual void setAdditivity (bool additivity)
virtual void setAdditivity (bool additivity)
virtual void setContext (const std::string &context)
virtual void setContext (const std::string &context)
virtual ~FixedContextCategory ()
virtual ~FixedContextCategory ()

Protected Member Functions

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

Private Attributes

std::string _context
Category_delegate

Detailed Description

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.

Since:
0.2.4

Definition at line 28 of file include/log4cpp/FixedContextCategory.hh.


Constructor & Destructor Documentation

log4cpp::FixedContextCategory::FixedContextCategory ( const std::string &  name,
const std::string &  context = "" 
)

Constructor

Parameters:
name the fully qualified name of this Categories delegate Category.
context the context to fill the NDC field of LoggingEvents with.

Definition at line 14 of file FixedContextCategory.cpp.

log4cpp::FixedContextCategory::~FixedContextCategory (  )  [virtual]

Destructor for Category.

Definition at line 21 of file FixedContextCategory.cpp.

log4cpp::FixedContextCategory::FixedContextCategory ( const std::string &  name,
const std::string &  context = "" 
)

Constructor

Parameters:
name the fully qualified name of this Categories delegate Category.
context the context to fill the NDC field of LoggingEvents with.
virtual log4cpp::FixedContextCategory::~FixedContextCategory (  )  [virtual]

Destructor for Category.


Member Function Documentation

virtual void log4cpp::FixedContextCategory::_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 from log4cpp::Category.

void log4cpp::FixedContextCategory::_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 from log4cpp::Category.

Definition at line 92 of file FixedContextCategory.cpp.

virtual void log4cpp::FixedContextCategory::addAppender ( Appender appender  )  [virtual]

For the moment this method does nothing.

Reimplemented from log4cpp::Category.

virtual void log4cpp::FixedContextCategory::addAppender ( Appender appender  )  throw () [virtual]

For the moment this method does nothing.

Reimplemented from log4cpp::Category.

void log4cpp::FixedContextCategory::addAppender ( Appender appender  )  [virtual]

For the moment this method does nothing.

Reimplemented from log4cpp::Category.

Definition at line 50 of file FixedContextCategory.cpp.

void log4cpp::FixedContextCategory::addAppender ( Appender appender  )  throw () [virtual]

For the moment this method does nothing.

Reimplemented from log4cpp::Category.

Definition at line 46 of file FixedContextCategory.cpp.

virtual void log4cpp::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.

Parameters:
event The LoggingEvent to log.

Reimplemented from log4cpp::Category.

void log4cpp::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.

Parameters:
event The LoggingEvent to log.

Reimplemented from log4cpp::Category.

Definition at line 79 of file FixedContextCategory.cpp.

virtual bool log4cpp::FixedContextCategory::getAdditivity (  )  const throw () [virtual]

Returns the additivity flag for this Category instance.

Reimplemented from log4cpp::Category.

bool log4cpp::FixedContextCategory::getAdditivity (  )  const throw () [virtual]

Returns the additivity flag for this Category instance.

Reimplemented from log4cpp::Category.

Definition at line 88 of file FixedContextCategory.cpp.

virtual AppenderSet log4cpp::FixedContextCategory::getAllAppenders (  )  const [virtual]

Returns the set of Appenders currently attached to this Catogory.

Since:
0.3.1
Returns:
The set of attached Appenders.

Reimplemented from log4cpp::Category.

AppenderSet log4cpp::FixedContextCategory::getAllAppenders (  )  const [virtual]

Returns the set of Appenders currently attached to this Catogory.

Since:
0.3.1
Returns:
The set of attached Appenders.

Reimplemented from log4cpp::Category.

Definition at line 63 of file FixedContextCategory.cpp.

virtual Appender* log4cpp::FixedContextCategory::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 from log4cpp::Category.

virtual Appender* log4cpp::FixedContextCategory::getAppender (  )  const [virtual]

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

Returns:
The Appender.

Reimplemented from log4cpp::Category.

Appender * log4cpp::FixedContextCategory::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 from log4cpp::Category.

Definition at line 58 of file FixedContextCategory.cpp.

Appender * log4cpp::FixedContextCategory::getAppender (  )  const [virtual]

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

Returns:
The Appender.

Reimplemented from log4cpp::Category.

Definition at line 54 of file FixedContextCategory.cpp.

virtual Priority::Value log4cpp::FixedContextCategory::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 from log4cpp::Category.

Priority::Value log4cpp::FixedContextCategory::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 from log4cpp::Category.

Definition at line 36 of file FixedContextCategory.cpp.

virtual std::string log4cpp::FixedContextCategory::getContext (  )  const [virtual]

Return the context string used as NDC.

Returns:
the context string.
std::string log4cpp::FixedContextCategory::getContext (  )  const [virtual]

Return the context string used as NDC.

Returns:
the context string.

Definition at line 28 of file FixedContextCategory.cpp.

virtual Priority::Value log4cpp::FixedContextCategory::getPriority (  )  const throw () [virtual]

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

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

Reimplemented from log4cpp::Category.

Priority::Value log4cpp::FixedContextCategory::getPriority (  )  const throw () [virtual]

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

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

Reimplemented from log4cpp::Category.

Definition at line 32 of file FixedContextCategory.cpp.

virtual bool log4cpp::FixedContextCategory::ownsAppender ( Appender appender  )  const throw () [virtual]

FixedContextAppenders cannot own Appenders.

Returns:
false

Reimplemented from log4cpp::Category.

virtual bool log4cpp::FixedContextCategory::ownsAppender (  )  const throw () [virtual]

FixedContextAppenders cannot own Appenders.

Returns:
false

Reimplemented from log4cpp::Category.

bool log4cpp::FixedContextCategory::ownsAppender ( Appender appender  )  const throw () [virtual]

FixedContextAppenders cannot own Appenders.

Returns:
false

Reimplemented from log4cpp::Category.

Definition at line 75 of file FixedContextCategory.cpp.

bool log4cpp::FixedContextCategory::ownsAppender (  )  const throw () [virtual]

FixedContextAppenders cannot own Appenders.

Returns:
false

Reimplemented from log4cpp::Category.

Definition at line 71 of file FixedContextCategory.cpp.

virtual void log4cpp::FixedContextCategory::removeAllAppenders (  )  [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.

void log4cpp::FixedContextCategory::removeAllAppenders (  )  [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 67 of file FixedContextCategory.cpp.

virtual void log4cpp::FixedContextCategory::setAdditivity ( bool  additivity  )  [virtual]

Set the additivity flag for this Category instance.

Reimplemented from log4cpp::Category.

void log4cpp::FixedContextCategory::setAdditivity ( bool  additivity  )  [virtual]

Set the additivity flag for this Category instance.

Reimplemented from log4cpp::Category.

Definition at line 84 of file FixedContextCategory.cpp.

virtual void log4cpp::FixedContextCategory::setContext ( const std::string &  context  )  [virtual]

Set the context string used as NDC.

Parameters:
context the context string
void log4cpp::FixedContextCategory::setContext ( const std::string &  context  )  [virtual]

Set the context string used as NDC.

Parameters:
context the context string

Definition at line 24 of file FixedContextCategory.cpp.


Member Data Documentation

The context of this FixedContextCategory.

Definition at line 155 of file include/log4cpp/FixedContextCategory.hh.

The delegate category of this FixedContextCategory.

Definition at line 152 of file include/log4cpp/FixedContextCategory.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


log4cpp
Author(s): Stephen Roderick
autogenerated on Fri Jan 11 09:51:55 2013