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();
121 virtual
void setPriority(
Priority::Value priority);
127 virtual
Priority::Value getPriority() const LOG4CPP_NOTHROW;
137 virtual
Priority::Value getChainedPriority() const LOG4CPP_NOTHROW;
145 virtual
bool isPriorityEnabled(
Priority::Value priority) const LOG4CPP_NOTHROW;
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());
257 virtual void setAdditivity(
bool additivity);
262 virtual bool getAdditivity() const LOG4CPP_NOTHROW;
269 virtual
Category* getParent() LOG4CPP_NOTHROW;
276 virtual const
Category* getParent() const LOG4CPP_NOTHROW;
285 virtual
void log(
Priority::Value priority, const
char* stringFormat,
286 ...) LOG4CPP_NOTHROW;
293 virtual
void log(
Priority::Value priority,
294 const
std::
string& message) LOG4CPP_NOTHROW;
304 virtual
void logva(
Priority::Value priority,
305 const
char* stringFormat,
306 va_list va) LOG4CPP_NOTHROW;
314 void debug(const
char* stringFormat, ...) LOG4CPP_NOTHROW;
320 void debug(const
std::
string& message) LOG4CPP_NOTHROW;
326 inline
bool isDebugEnabled() const LOG4CPP_NOTHROW {
344 void info(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
350 void info(const
std::
string& message) LOG4CPP_NOTHROW;
356 inline
bool isInfoEnabled() const LOG4CPP_NOTHROW {
374 void notice(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
380 void notice(const
std::
string& message) LOG4CPP_NOTHROW;
386 inline
bool isNoticeEnabled() const LOG4CPP_NOTHROW {
404 void warn(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
410 void warn(const
std::
string& message) LOG4CPP_NOTHROW;
416 inline
bool isWarnEnabled() const LOG4CPP_NOTHROW {
434 void error(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
440 void error(const
std::
string& message) LOG4CPP_NOTHROW;
446 inline
bool isErrorEnabled() const LOG4CPP_NOTHROW {
464 void crit(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
470 void crit(const
std::
string& message) LOG4CPP_NOTHROW;
476 inline
bool isCritEnabled() const LOG4CPP_NOTHROW {
494 void alert(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
500 void alert(const
std::
string& message) LOG4CPP_NOTHROW;
506 inline
bool isAlertEnabled() const LOG4CPP_NOTHROW {
524 void emerg(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
530 void emerg(const
std::
string& message) LOG4CPP_NOTHROW;
536 inline
bool isEmergEnabled() const LOG4CPP_NOTHROW {
556 void fatal(
const char* stringFormat, ...) LOG4CPP_NOTHROW;
564 void fatal(const
std::
string& message) LOG4CPP_NOTHROW;
572 inline
bool isFatalEnabled() const LOG4CPP_NOTHROW {
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;
675 #endif // _LOG4CPP_CATEGORY_HH
CategoryStream warnStream()
Return a CategoryStream with priority WARN.
Definition: Category.hh:424
CategoryStream debugStream()
Return a CategoryStream with priority DEBUG.
Definition: Category.hh:334
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:10
Definition: Priority.hh:70
HierarchyMaintainer is an internal log4cpp class.
Definition: HierarchyMaintainer.hh:27
Definition: Portability.hh:59
CategoryStream infoStream()
Return a CategoryStream with priority INFO.
Definition: Category.hh:364
Definition: Priority.hh:73
Definition: Priority.hh:71
Definition: Priority.hh:72
CategoryStream alertStream() LOG4CPP_NOTHROW
Return a CategoryStream with priority ALERT.
Definition: Category.hh:514
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:186
CategoryStream fatalStream()
Return a CategoryStream with priority FATAL.
Definition: Category.hh:582
#define LOG4CPP_EXPORT
Definition: Export.hh:26
The top level namespace for all 'Log for C++' types and classes.
Definition: AbortAppender.hh:16
virtual bool ownsAppender() const LOG4CPP_NOTHROW
Returns true if the Category owns the first Appender in its Appender set.
Definition: Category.hh:230
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:165
CategoryStream critStream()
Return a CategoryStream with priority CRIT.
Definition: Category.hh:484
CategoryStream errorStream()
Return a CategoryStream with priority ERROR.
Definition: Category.hh:454
CategoryStream noticeStream()
Return a CategoryStream with priority NOTICE.
Definition: Category.hh:394
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:34
Definition: PThreads.hh:29
class LOG4CPP_EXPORT Category
Definition: CategoryStream.hh:23
Definition: Priority.hh:78
Definition: Priority.hh:74
#define LOG4CPP_NOTHROW
Definition: Portability.hh:80
Definition: Priority.hh:75
Definition: Priority.hh:76
CategoryStream emergStream()
Return a CategoryStream with priority EMERG.
Definition: Category.hh:544