10 #ifndef _LOG4CPP_CATEGORY_HH
11 #define _LOG4CPP_CATEGORY_HH
19 #include <log4cpp/convenience.h>
69 static
Category& getInstance(const std::
string& name);
76 static
Category* exists(const std::
string& name);
90 static std::vector<
Category*>* getCurrentCategories();
95 static
void shutdown();
106 virtual const std::
string& getName() const throw();
115 virtual
void setPriority(
Priority::Value priority)
116 throw(std::invalid_argument);
122 virtual
Priority::Value getPriority() const throw();
132 virtual
Priority::Value getChainedPriority() const throw();
140 virtual
bool isPriorityEnabled(
Priority::Value priority) const throw();
149 virtual
void addAppender(
Appender* appender)
150 throw(std::invalid_argument);
158 virtual
void addAppender(
Appender& appender);
170 addAppender(appender);
172 removeAllAppenders();
183 addAppender(appender);
192 virtual Appender* getAppender()
const;
200 virtual Appender* getAppender(
const std::string& name)
const;
212 virtual void removeAllAppenders();
218 virtual void removeAppender(
Appender* appender);
227 return ownsAppender(getAppender());
235 virtual bool ownsAppender(
Appender* appender)
const throw();
248 virtual void callAppenders(
const LoggingEvent& event)
throw();
253 virtual void setAdditivity(
bool additivity);
258 virtual bool getAdditivity()
const throw();
265 virtual
Category* getParent() throw();
272 virtual const
Category* getParent() const throw();
281 virtual
void log(
Priority::Value priority, const
char* stringFormat,
289 virtual
void log(
Priority::Value priority,
290 const std::
string& message) throw();
300 virtual
void logva(
Priority::Value priority,
301 const
char* stringFormat,
310 void debug(const
char* stringFormat, ...) throw();
316 void debug(const std::
string& message) throw();
322 inline
bool isDebugEnabled() const throw() {
340 void info(
const char* stringFormat, ...) throw();
346 void info(const std::
string& message) throw();
352 inline
bool isInfoEnabled() const throw() {
370 void notice(
const char* stringFormat, ...) throw();
376 void notice(const std::
string& message) throw();
382 inline
bool isNoticeEnabled() const throw() {
400 void warn(
const char* stringFormat, ...) throw();
406 void warn(const std::
string& message) throw();
412 inline
bool isWarnEnabled() const throw() {
430 void error(
const char* stringFormat, ...) throw();
436 void error(const std::
string& message) throw();
442 inline
bool isErrorEnabled() const throw() {
460 void crit(
const char* stringFormat, ...) throw();
466 void crit(const std::
string& message) throw();
472 inline
bool isCritEnabled() const throw() {
490 void alert(
const char* stringFormat, ...) throw();
496 void alert(const std::
string& message) throw();
502 inline
bool isAlertEnabled() const throw() {
520 void emerg(
const char* stringFormat, ...) throw();
526 void emerg(const std::
string& message) throw();
532 inline
bool isEmergEnabled() const throw() {
552 void fatal(
const char* stringFormat, ...) throw();
560 void fatal(const std::
string& message) throw();
568 inline
bool isFatalEnabled() const throw() {
611 va_list arguments)
throw();
619 const std::string& message)
throw();
628 const std::string _name;
641 typedef std::map<Appender *, bool> OwnsAppenderMap;
649 virtual bool ownsAppender(
Appender* appender,
650 OwnsAppenderMap::iterator& i2)
throw();
660 OwnsAppenderMap _ownsAppender;
666 volatile bool _isAdditive;
671 #endif // _LOG4CPP_CATEGORY_HH
CategoryStream warnStream()
Return a CategoryStream with priority WARN.
Definition: Category.hh:420
CategoryStream debugStream()
Return a CategoryStream with priority DEBUG.
Definition: Category.hh:330
Definition: Priority.hh:77
This is the central class in the log4j package.
Definition: Category.hh:33
ostream & operator<<(ostream &os, const width &w)
Definition: Manipulator.cpp:4
Definition: Priority.hh:70
HierarchyMaintainer is an internal log4cpp class.
Definition: HierarchyMaintainer.hh:27
CategoryStream infoStream()
Return a CategoryStream with priority INFO.
Definition: Category.hh:360
Definition: Priority.hh:73
virtual bool ownsAppender() const
Returns true if the Category owns the first Appender in its Appender set.
Definition: Category.hh:226
Definition: Priority.hh:71
Definition: Priority.hh:72
Definition: Priority.hh:79
This class enables streaming simple types and objects to a category.
Definition: CategoryStream.hh:39
void setAppender(Appender &appender)
Adds an Appender for this Category.
Definition: Category.hh:182
CategoryStream fatalStream()
Return a CategoryStream with priority FATAL.
Definition: Category.hh:578
#define LOG4CPP_EXPORT
Definition: Export.hh:19
The internal representation of logging events.
Definition: LoggingEvent.hh:32
int Value
The type of Priority Values.
Definition: Priority.hh:85
std::set< Appender * > AppenderSet
Definition: Appender.hh:147
CategoryStream critStream()
Return a CategoryStream with priority CRIT.
Definition: Category.hh:480
CategoryStream errorStream()
Return a CategoryStream with priority ERROR.
Definition: Category.hh:450
CategoryStream noticeStream()
Return a CategoryStream with priority NOTICE.
Definition: Category.hh:390
The Priority class provides importance levels with which one can categorize log messages.
Definition: Priority.hh:61
Implement this interface for your own strategies for printing log statements.
Definition: Appender.hh:33
Definition: PThreads.hh:29
class LOG4CPP_EXPORT Category
Definition: CategoryStream.hh:23
CategoryStream alertStream()
Return a CategoryStream with priority ALERT.
Definition: Category.hh:510
Definition: Priority.hh:78
Definition: Priority.hh:74
Definition: Priority.hh:75
Definition: Priority.hh:76
CategoryStream emergStream()
Return a CategoryStream with priority EMERG.
Definition: Category.hh:540