10#ifndef _LOG4CPP_CATEGORY_HH
11#define _LOG4CPP_CATEGORY_HH
19#include <log4cpp/convenience.h>
69 static
Category& getInstance(const
std::
string& name);
90 static
std::vector<
Category*>* getCurrentCategories();
95 static
void shutdown();
101 static
void shutdownForced();
112 virtual const
std::
string& getName() const throw();
121 virtual
void setPriority(
Priority::Value priority);
127 virtual
Priority::Value getPriority() const throw();
137 virtual
Priority::Value getChainedPriority() const throw();
145 virtual
bool isPriorityEnabled(
Priority::Value priority) const throw();
154 virtual
void addAppender(
Appender* appender);
162 virtual
void addAppender(
Appender& appender);
174 addAppender(appender);
176 removeAllAppenders();
187 addAppender(appender);
196 virtual Appender* getAppender()
const;
204 virtual Appender* getAppender(
const std::string& name)
const;
216 virtual void removeAllAppenders();
222 virtual void removeAppender(
Appender* appender);
231 return ownsAppender(getAppender());
239 virtual bool ownsAppender(
Appender* appender)
const throw();
252 virtual void callAppenders(
const LoggingEvent& event)
throw();
257 virtual void setAdditivity(
bool additivity);
262 virtual bool getAdditivity()
const throw();
269 virtual
Category* getParent() throw();
276 virtual const
Category* getParent() const throw();
285 virtual
void log(
Priority::Value priority, const
char* stringFormat,
293 virtual
void log(
Priority::Value priority,
294 const
std::
string& message) throw();
304 virtual
void logva(
Priority::Value priority,
305 const
char* stringFormat,
314 void debug(const
char* stringFormat, ...) throw();
320 void debug(const
std::
string& message) throw();
326 inline
bool isDebugEnabled() const throw() {
327 return isPriorityEnabled(Priority::DEBUG);
335 return getStream(Priority::DEBUG);
344 void info(
const char* stringFormat, ...) throw();
350 void info(const
std::
string& message) throw();
356 inline
bool isInfoEnabled() const throw() {
357 return isPriorityEnabled(Priority::INFO);
365 return getStream(Priority::INFO);
374 void notice(
const char* stringFormat, ...) throw();
380 void notice(const
std::
string& message) throw();
386 inline
bool isNoticeEnabled() const throw() {
387 return isPriorityEnabled(Priority::NOTICE);
395 return getStream(Priority::NOTICE);
404 void warn(
const char* stringFormat, ...) throw();
410 void warn(const
std::
string& message) throw();
416 inline
bool isWarnEnabled() const throw() {
417 return isPriorityEnabled(Priority::WARN);
425 return getStream(Priority::WARN);
434 void error(
const char* stringFormat, ...) throw();
440 void error(const
std::
string& message) throw();
446 inline
bool isErrorEnabled() const throw() {
447 return isPriorityEnabled(Priority::ERROR);
455 return getStream(Priority::ERROR);
464 void crit(
const char* stringFormat, ...) throw();
470 void crit(const
std::
string& message) throw();
476 inline
bool isCritEnabled() const throw() {
477 return isPriorityEnabled(Priority::CRIT);
485 return getStream(Priority::CRIT);
494 void alert(
const char* stringFormat, ...) throw();
500 void alert(const
std::
string& message) throw();
506 inline
bool isAlertEnabled() const throw() {
507 return isPriorityEnabled(Priority::ALERT);
515 return getStream(Priority::ALERT);
524 void emerg(
const char* stringFormat, ...) throw();
530 void emerg(const
std::
string& message) throw();
536 inline
bool isEmergEnabled() const throw() {
537 return isPriorityEnabled(Priority::EMERG);
545 return getStream(Priority::EMERG);
556 void fatal(
const char* stringFormat, ...) throw();
564 void fatal(const
std::
string& message) throw();
572 inline
bool isFatalEnabled() const throw() {
573 return isPriorityEnabled(Priority::FATAL);
583 return getStream(Priority::FATAL);
615 va_list arguments)
throw();
623 const std::string& message)
throw();
632 const std::string _name;
645 typedef std::map<Appender *, bool> OwnsAppenderMap;
653 virtual bool ownsAppender(
Appender* appender,
654 OwnsAppenderMap::iterator& i2)
throw();
664 OwnsAppenderMap _ownsAppender;
670 volatile bool _isAdditive;
#define LOG4CPP_EXPORT
Definition: Export.hh:26
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
virtual bool ownsAppender() const
Returns true if the Category owns the first Appender in its Appender set.
Definition: Category.hh:230
CategoryStream critStream()
Return a CategoryStream with priority CRIT.
Definition: Category.hh:484
CategoryStream alertStream()
Return a CategoryStream with priority ALERT.
Definition: Category.hh:514
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
CategoryStream fatalStream()
Return a CategoryStream with priority FATAL.
Definition: Category.hh:582
CategoryStream warnStream()
Return a CategoryStream with priority WARN.
Definition: Category.hh:424
void setAppender(Appender &appender)
Adds an Appender for this Category.
Definition: Category.hh:186
CategoryStream errorStream()
Return a CategoryStream with priority ERROR.
Definition: Category.hh:454
CategoryStream debugStream()
Return a CategoryStream with priority DEBUG.
Definition: Category.hh:334
HierarchyMaintainer is an internal log4cpp class.
Definition: HierarchyMaintainer.hh:27
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
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