Loading...
Searching...
No Matches
FixedContextCategory.hh
Go to the documentation of this file.
/*
* FixedContextCategory.hh
*
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2001, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#ifndef _LOG4SHIB_FIXEDCONTEXTCATEGORY_HH
#define _LOG4SHIB_FIXEDCONTEXTCATEGORY_HH
#include <log4shib/Portability.hh>
#include <log4shib/Category.hh>
namespace log4shib {
class LOG4SHIB_EXPORT FixedContextCategory : public Category {
public:
FixedContextCategory(const std::string& name,
const std::string& context = "");
virtual ~FixedContextCategory();
virtual void setContext(const std::string& context);
virtual std::string getContext() const;
virtual Priority::Value getPriority() const throw();
virtual Priority::Value getChainedPriority() const throw();
virtual void addAppender(Appender* appender) throw();
virtual void addAppender(Appender& appender);
virtual Appender* getAppender() const;
virtual Appender* getAppender(const std::string& name) const;
virtual AppenderSet getAllAppenders() const;
virtual void removeAllAppenders();
virtual bool ownsAppender(Appender* appender)
const throw();
virtual void callAppenders(const LoggingEvent& event) throw();
virtual void setAdditivity(bool additivity);
virtual bool getAdditivity() const throw();
protected:
virtual void _logUnconditionally2(Priority::Value priority,
const std::string& message) throw();
private:
Category& _delegate;
std::string _context;
};
}
#endif // _LOG4SHIB_FIXEDCONTEXTCATEGORY_HH
Category.hh
LOG4SHIB_EXPORT
#define LOG4SHIB_EXPORT
Definition Export.hh:11
Portability.hh
log4shib::Appender
Implement this interface for your own strategies for printing log statements.
Definition Appender.hh:33
log4shib::Category::Category
Category(const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)
Constructor.
Definition Category.cpp:52
log4shib::FixedContextCategory::getAdditivity
virtual bool getAdditivity() const
Returns the additivity flag for this Category instance.
Definition FixedContextCategory.cpp:85
log4shib::FixedContextCategory::getAppender
virtual Appender * getAppender() const
Returns the Appender for this Category, or NULL if no Appender has been set.
Definition FixedContextCategory.cpp:55
log4shib::FixedContextCategory::addAppender
virtual void addAppender(Appender *appender)
For the moment this method does nothing.
Definition FixedContextCategory.cpp:47
log4shib::FixedContextCategory::FixedContextCategory
FixedContextCategory(const std::string &name, const std::string &context="")
Constructor.
Definition FixedContextCategory.cpp:15
log4shib::FixedContextCategory::removeAllAppenders
virtual void removeAllAppenders()
Removes all appenders set for this Category.
Definition FixedContextCategory.cpp:68
log4shib::FixedContextCategory::getAllAppenders
virtual AppenderSet getAllAppenders() const
Returns the set of Appenders currently attached to this Catogory.
Definition FixedContextCategory.cpp:64
log4shib::FixedContextCategory::getChainedPriority
virtual Priority::Value getChainedPriority() const
Starting from this Category, search the category hierarchy for a set priority and return it.
Definition FixedContextCategory.cpp:37
log4shib::FixedContextCategory::_logUnconditionally2
virtual void _logUnconditionally2(Priority::Value priority, const std::string &message)
Unconditionally log a message with the specified priority.
Definition FixedContextCategory.cpp:89
log4shib::FixedContextCategory::ownsAppender
virtual bool ownsAppender(Appender *appender) const
FixedContextAppenders cannot own Appenders.
Definition FixedContextCategory.cpp:72
log4shib::FixedContextCategory::setContext
virtual void setContext(const std::string &context)
Set the context string used as NDC.
Definition FixedContextCategory.cpp:25
log4shib::FixedContextCategory::getContext
virtual std::string getContext() const
Return the context string used as NDC.
Definition FixedContextCategory.cpp:29
log4shib::FixedContextCategory::setAdditivity
virtual void setAdditivity(bool additivity)
Set the additivity flag for this Category instance.
Definition FixedContextCategory.cpp:81
log4shib::FixedContextCategory::getPriority
virtual Priority::Value getPriority() const
Returns the assigned Priority, if any, for this Category.
Definition FixedContextCategory.cpp:33
log4shib::FixedContextCategory::callAppenders
virtual void callAppenders(const LoggingEvent &event)
Call the appenders in the hierarchy starting at this.
Definition FixedContextCategory.cpp:76
log4shib::Priority::Value
int Value
The type of Priority Values.
Definition Priority.hh:84
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
log4shib::AppenderSet
std::set< Appender * > AppenderSet
Definition Appender.hh:147
log4shib::LoggingEvent
The internal representation of logging events.
Definition LoggingEvent.hh:32