10#ifndef _LOG4CPP_CATEGORY_HH
11#define _LOG4CPP_CATEGORY_HH
19#include <log4cpp/convenience.h>
196 virtual Appender* getAppender()
const;
204 virtual Appender* getAppender(
const std::string& name)
const;
216 virtual void removeAllAppenders();
222 virtual void removeAppender(
Appender* appender);
257 virtual void setAdditivity(
bool additivity);
285 virtual
void log(
Priority::Value priority, const
char* stringFormat,
293 virtual
void log(
Priority::Value priority,
304 virtual
void logva(
Priority::Value priority,
305 const
char* stringFormat,
632 const std::string _name;
645 typedef std::map<Appender *, bool> OwnsAppenderMap;
653 virtual bool ownsAppender(
Appender* appender,
664 OwnsAppenderMap _ownsAppender;
670 volatile bool _isAdditive;
#define LOG4CPP_EXPORT
Definition Export.hh:26
#define LOG4CPP_NOTHROW
Definition Portability.hh:80
Implement this interface for your own strategies for printing log statements.
Definition Appender.hh:34
This class enables streaming simple types and objects to a category.
Definition CategoryStream.hh:39
This is the central class in the log4j package.
Definition Category.hh:33
bool isInfoEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority INFO.
Definition Category.hh:356
friend class HierarchyMaintainer
Definition Category.hh:34
virtual const std::string & getName() const LOG4CPP_NOTHROW
Return the category name.
Definition Category.cpp:69
virtual bool isPriorityEnabled(Priority::Value priority) const LOG4CPP_NOTHROW
Returns true if the chained priority of the Category is equal to or higher than given priority.
Definition Category.cpp:267
bool isEmergEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority EMERG.
Definition Category.hh:536
static Category & getRoot()
Return the root of the Category hierarchy.
Definition Category.cpp:23
CategoryStream critStream()
Return a CategoryStream with priority CRIT.
Definition Category.hh:484
bool isFatalEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority FATAL.
Definition Category.hh:572
static Category & getInstance(const std::string &name)
Instantiate a Category with name name.
Definition Category.cpp:35
virtual Priority::Value getPriority() const LOG4CPP_NOTHROW
Returns the assigned Priority, if any, for this Category.
Definition Category.cpp:73
virtual Appender * getAppender() const
Returns the first Appender for this Category, or NULL if no Appender has been set.
Definition Category.cpp:126
virtual void setPriority(Priority::Value priority)
Set the priority of this Category.
Definition Category.cpp:77
bool isAlertEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority ALERT.
Definition Category.hh:506
bool isDebugEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority DEBUG.
Definition Category.hh:326
CategoryStream noticeStream()
Return a CategoryStream with priority NOTICE.
Definition Category.hh:394
CategoryStream emergStream()
Return a CategoryStream with priority EMERG.
Definition Category.hh:544
CategoryStream infoStream()
Return a CategoryStream with priority INFO.
Definition Category.hh:364
bool isCritEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority CRIT.
Definition Category.hh:476
CategoryStream alertStream() LOG4CPP_NOTHROW
Return a CategoryStream with priority ALERT.
Definition Category.hh:514
Category(const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)
Constructor.
Definition Category.cpp:58
bool isErrorEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority ERROR.
Definition Category.hh:446
static void shutdown()
This method will remove all Appenders from Categories.XXX.
Definition Category.cpp:48
virtual Priority::Value getChainedPriority() const LOG4CPP_NOTHROW
Starting from this Category, search the category hierarchy for a set priority and return it.
Definition Category.cpp:88
CategoryStream fatalStream()
Return a CategoryStream with priority FATAL.
Definition Category.hh:582
bool isWarnEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority WARN.
Definition Category.hh:416
static Priority::Value getRootPriority() LOG4CPP_NOTHROW
Get the priority of the root Category.
Definition Category.cpp:31
virtual void removeAllAppenders()
Removes all appenders for this Category.
Definition Category.cpp:155
static std::vector< Category * > * getCurrentCategories()
Returns all the currently defined categories as a vector of Category pointers.
Definition Category.cpp:43
CategoryStream warnStream()
Return a CategoryStream with priority WARN.
Definition Category.hh:424
virtual bool ownsAppender() const LOG4CPP_NOTHROW
Returns true if the Category owns the first Appender in its Appender set.
Definition Category.hh:230
virtual CategoryStream getStream(Priority::Value priority)
Return a CategoryStream with given Priority.
Definition Category.cpp:421
static Category * exists(const std::string &name)
If the named category exists (in the default hierarchy) then it returns a reference to the category,...
Definition Category.cpp:39
void setAppender(Appender &appender)
Adds an Appender for this Category.
Definition Category.hh:186
bool isNoticeEnabled() const LOG4CPP_NOTHROW
Return true if the Category will log messages with priority NOTICE.
Definition Category.hh:386
static void setRootPriority(Priority::Value priority)
Set the priority of the root Category.
Definition Category.cpp:27
static void shutdownForced()
This method will remove all Appenders from Categories.XXX and delete all appenders.
Definition Category.cpp:52
CategoryStream errorStream()
Return a CategoryStream with priority ERROR.
Definition Category.hh:454
CategoryStream debugStream()
Return a CategoryStream with priority DEBUG.
Definition Category.hh:334
void setAppender(Appender *appender)
Adds an Appender to this Category.
Definition Category.hh:172
virtual void addAppender(Appender *appender)
Adds an Appender to this Category.
Definition Category.cpp:99
The Priority class provides importance levels with which one can categorize log messages.
Definition Priority.hh:61
int Value
The type of Priority Values.
Definition Priority.hh:85
@ FATAL
Definition Priority.hh:71
@ CRIT
Definition Priority.hh:73
@ DEBUG
Definition Priority.hh:78
@ EMERG
Definition Priority.hh:70
@ INFO
Definition Priority.hh:77
@ ALERT
Definition Priority.hh:72
@ WARN
Definition Priority.hh:75
@ ERROR
Definition Priority.hh:74
@ NOTICE
Definition Priority.hh:76
@ NOTSET
Definition Priority.hh:79
Definition PThreads.hh:29
The top level namespace for all 'Log for C++' types and classes.
Definition AbortAppender.hh:16
std::set< Appender * > AppenderSet
Definition Appender.hh:165
ostream & operator<<(ostream &os, const width &w)
Definition Manipulator.cpp:10
Definition Portability.hh:59
The internal representation of logging events.
Definition LoggingEvent.hh:32