Public Member Functions | Protected Member Functions | Private Attributes | List of all members
FixedContextCategory Class Reference

This Category subclass replaces the NDC field in LoggingEvents with a fixed context string. More...

#include <FixedContextCategory.hh>

Inheritance diagram for FixedContextCategory:
Inheritance graph
[legend]

Public Member Functions

virtual void addAppender (Appender *appender) throw ()
 For the moment this method does nothing. More...
 
virtual void addAppender (Appender &appender)
 For the moment this method does nothing. More...
 
virtual void callAppenders (const LoggingEvent &event) throw ()
 Call the appenders in the hierarchy starting at this. More...
 
 FixedContextCategory (const std::string &name, const std::string &context="")
 Constructor. More...
 
virtual bool getAdditivity () const throw ()
 Returns the additivity flag for this Category instance. More...
 
virtual AppenderSet getAllAppenders () const
 Returns the set of Appenders currently attached to this Catogory. More...
 
virtual AppendergetAppender () const
 Returns the Appender for this Category, or NULL if no Appender has been set. More...
 
virtual AppendergetAppender (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 Priority::Value getChainedPriority () const throw ()
 Starting from this Category, search the category hierarchy for a set priority and return it. More...
 
virtual std::string getContext () const
 Return the context string used as NDC. More...
 
virtual Priority::Value getPriority () const throw ()
 Returns the assigned Priority, if any, for this Category. More...
 
virtual bool ownsAppender () const throw ()
 FixedContextAppenders cannot own Appenders. More...
 
virtual bool ownsAppender (Appender *appender) const throw ()
 FixedContextAppenders cannot own Appenders. More...
 
virtual void removeAllAppenders ()
 Removes all appenders set for this Category. More...
 
virtual void setAdditivity (bool additivity)
 Set the additivity flag for this Category instance. More...
 
virtual void setContext (const std::string &context)
 Set the context string used as NDC. More...
 
virtual ~FixedContextCategory ()
 Destructor for Category. More...
 
- Public Member Functions inherited from Category
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...
 
CategoryStream alertStream () throw ()
 Return a CategoryStream with priority ALERT. 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...
 
CategoryStream critStream ()
 Return a CategoryStream with priority CRIT. 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...
 
CategoryStream debugStream ()
 Return a CategoryStream with priority DEBUG. 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...
 
CategoryStream emergStream ()
 Return a CategoryStream with priority EMERG. 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...
 
CategoryStream errorStream ()
 Return a CategoryStream with priority ERROR. 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...
 
CategoryStream fatalStream ()
 Return a CategoryStream with priority FATAL. More...
 
virtual const std::string & getName () const throw ()
 Return the category name. More...
 
virtual CategorygetParent () throw ()
 Returns the parent category of this category, or NULL if the category is the root category. More...
 
virtual const CategorygetParent () const throw ()
 Returns the parent category of this category, or NULL if the category is the root category. More...
 
virtual CategoryStream getStream (Priority::Value priority)
 Return a CategoryStream with given Priority. 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...
 
void info_pop (const char *stringFormat,...) throw ()
 Log a message with info priority & pops an indentation to the NDC stack. More...
 
void info_push (const char *stringFormat,...) throw ()
 Log a message with info priority & pushes an indentation to the NDC stack. More...
 
CategoryStream infoStream ()
 Return a CategoryStream with priority INFO. More...
 
bool isAlertEnabled () const throw ()
 Return true if the Category will log messages with priority ALERT. More...
 
bool isCritEnabled () const throw ()
 Return true if the Category will log messages with priority CRIT. More...
 
bool isDebugEnabled () throw ()
 Return true if the Category will log messages with priority DEBUG. More...
 
bool isEmergEnabled () const throw ()
 Return true if the Category will log messages with priority EMERG. More...
 
bool isErrorEnabled () const throw ()
 Return true if the Category will log messages with priority ERROR. More...
 
bool isFatalEnabled () const throw ()
 Return true if the Category will log messages with priority FATAL. More...
 
bool isInfoEnabled () throw ()
 Return true if the Category will log messages with priority INFO. More...
 
bool isNoticeEnabled () const throw ()
 Return true if the Category will log messages with priority NOTICE. 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...
 
bool isWarnEnabled () throw ()
 Return true if the Category will log messages with priority WARN. 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 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...
 
CategoryStream noticeStream ()
 Return a CategoryStream with priority NOTICE. More...
 
virtual CategoryStream operator<< (Priority::Value priority)
 Return a CategoryStream with given Priority. More...
 
virtual void removeAppender (Appender *appender)
 Removes specified 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 void setPriority (Priority::Value priority)
 Set the priority of this Category. 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...
 
CategoryStream warnStream ()
 Return a CategoryStream with priority WARN. More...
 
virtual ~Category ()
 Destructor for Category. More...
 

Protected Member Functions

virtual void _logUnconditionally2 (Priority::Value priority, const std::string &message) throw ()
 Unconditionally log a message with the specified priority. More...
 
- Protected Member Functions inherited from 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)
 Constructor. More...
 

Private Attributes

std::string _context
 The context of this FixedContextCategory. More...
 
Category_delegate
 The delegate category of this FixedContextCategory. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Category
static Categoryexists (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 CategorygetInstance (const std::string &name)
 Instantiate a Category with name name. More...
 
static CategorygetRoot ()
 Return the root of the Category hierarchy. More...
 
static Priority::Value getRootPriority () throw ()
 Get the priority of the root Category. More...
 
static void setRootPriority (Priority::Value priority)
 Set the priority of the root Category. More...
 
static void shutdown ()
 This method will remove all Appenders from Categories.XXX. More...
 

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 29 of file FixedContextCategory.hh.

Constructor & Destructor Documentation

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

Constructor.

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

Destructor for Category.

Member Function Documentation

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

Unconditionally log a message with the specified priority.

Parameters
priorityThe priority of this log message.
messagestring 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.

Parameters
eventThe LoggingEvent to log.

Reimplemented from Category.

virtual bool FixedContextCategory::getAdditivity ( ) const
throw (
)
virtual

Returns the additivity flag for this Category instance.

Reimplemented from Category.

virtual AppenderSet 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 Category.

virtual Appender* FixedContextCategory::getAppender ( ) const
virtual

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

Returns
The Appender.

Reimplemented from Category.

virtual Appender* 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 Category.

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

virtual std::string FixedContextCategory::getContext ( ) const
virtual

Return the context string used as NDC.

Returns
the context string.
virtual Priority::Value 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 Category.

virtual bool FixedContextCategory::ownsAppender ( ) const
throw (
)
virtual

FixedContextAppenders cannot own Appenders.

Returns
false

Reimplemented from Category.

virtual bool FixedContextCategory::ownsAppender ( Appender appender) const
throw (
)
virtual

FixedContextAppenders cannot own Appenders.

Returns
false

Reimplemented from Category.

virtual void 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 Category.

virtual void FixedContextCategory::setAdditivity ( bool  additivity)
virtual

Set the additivity flag for this Category instance.

Reimplemented from Category.

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

Set the context string used as NDC.

Parameters
contextthe context string

Member Data Documentation

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.


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


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Thu Jun 6 2019 19:10:55