log4cpp 1.1.6
Loading...
Searching...
No Matches
FixedContextCategory.hh
Go to the documentation of this file.
1/*
2 * FixedContextCategory.hh
3 *
4 * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5 * Copyright 2001, Bastiaan Bakker. All rights reserved.
6 *
7 * See the COPYING file for the terms of usage and distribution.
8 */
9
10#ifndef _LOG4CPP_FIXEDCONTEXTCATEGORY_HH
11#define _LOG4CPP_FIXEDCONTEXTCATEGORY_HH
12
13#include <log4cpp/Category.hh>
15
16namespace log4cpp {
17
30
31 public:
39 FixedContextCategory(const std::string& name, const std::string& context = "");
40
44 virtual ~FixedContextCategory();
45
50 virtual void setContext(const std::string& context);
51
56 virtual std::string getContext() const;
57
63
73
77 virtual void addAppender(Appender* appender) LOG4CPP_NOTHROW;
78
82 virtual void addAppender(Appender& appender);
83
89 virtual Appender* getAppender() const;
90
97 virtual Appender* getAppender(const std::string& name) const;
98
104 virtual AppenderSet getAllAppenders() const;
105
110 virtual void removeAllAppenders();
111
116 virtual bool ownsAppender() const LOG4CPP_NOTHROW;
117
122 virtual bool ownsAppender(Appender* appender) const LOG4CPP_NOTHROW;
123
135 virtual void callAppenders(const LoggingEvent& event) LOG4CPP_NOTHROW;
136
140 virtual void setAdditivity(bool additivity);
141
145 virtual bool getAdditivity() const LOG4CPP_NOTHROW;
146
147 protected:
153 virtual void _logUnconditionally2(Priority::Value priority, const std::string& message) LOG4CPP_NOTHROW;
154
155 private:
159 Category& _delegate;
160
162 std::string _context;
163 };
164
165} // namespace log4cpp
166#endif // _LOG4CPP_FIXEDCONTEXTCATEGORY_HH
#define LOG4CPP_EXPORT
Definition Export.hh:26
#define LOG4CPP_NOTHROW
Definition Portability.hh:82
Implement this interface for your own strategies for printing log statements.
Definition Appender.hh:34
Category(const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)
Constructor.
Definition Category.cpp:56
virtual void setAdditivity(bool additivity)
Set the additivity flag for this Category instance.
Definition FixedContextCategory.cpp:79
virtual Priority::Value getChainedPriority() const LOG4CPP_NOTHROW
Starting from this Category, search the category hierarchy for a set priority and return it.
Definition FixedContextCategory.cpp:33
virtual void addAppender(Appender *appender) LOG4CPP_NOTHROW
For the moment this method does nothing.
Definition FixedContextCategory.cpp:43
virtual void callAppenders(const LoggingEvent &event) LOG4CPP_NOTHROW
Call the appenders in the hierarchy starting at this.
Definition FixedContextCategory.cpp:75
virtual bool ownsAppender() const LOG4CPP_NOTHROW
FixedContextAppenders cannot own Appenders.
Definition FixedContextCategory.cpp:67
virtual bool getAdditivity() const LOG4CPP_NOTHROW
Returns the additivity flag for this Category instance.
Definition FixedContextCategory.cpp:83
virtual AppenderSet getAllAppenders() const
Returns the set of Appenders currently attached to this Catogory.
Definition FixedContextCategory.cpp:59
virtual std::string getContext() const
Return the context string used as NDC.
Definition FixedContextCategory.cpp:25
FixedContextCategory(const std::string &name, const std::string &context="")
Constructor.
Definition FixedContextCategory.cpp:15
virtual void _logUnconditionally2(Priority::Value priority, const std::string &message) LOG4CPP_NOTHROW
Unconditionally log a message with the specified priority.
Definition FixedContextCategory.cpp:87
virtual Appender * getAppender() const
Returns the Appender for this Category, or NULL if no Appender has been set.
Definition FixedContextCategory.cpp:51
virtual Priority::Value getPriority() const LOG4CPP_NOTHROW
Returns the assigned Priority, if any, for this Category.
Definition FixedContextCategory.cpp:29
virtual void removeAllAppenders()
Removes all appenders set for this Category.
Definition FixedContextCategory.cpp:63
virtual void setContext(const std::string &context)
Set the context string used as NDC.
Definition FixedContextCategory.cpp:21
int Value
The type of Priority Values.
Definition Priority.hh:85
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
std::set< Appender * > AppenderSet
Definition Appender.hh:177
The internal representation of logging events.
Definition LoggingEvent.hh:32