10#ifndef _LOG4SHIB_CATEGORY_HH
11#define _LOG4SHIB_CATEGORY_HH
105 virtual const
std::
string&
getName() const throw();
189 virtual Appender* getAppender()
const;
197 virtual Appender* getAppender(
const std::string& name)
const;
209 virtual void removeAllAppenders();
215 virtual void removeAppender(
Appender* appender);
232 virtual bool ownsAppender(
Appender* appender)
const throw();
245 virtual void callAppenders(
const LoggingEvent& event)
throw();
250 virtual void setAdditivity(
bool additivity);
255 virtual bool getAdditivity()
const throw();
262 virtual
Category* getParent() throw();
269 virtual const
Category* getParent() const throw();
278 virtual
void log(
Priority::Value priority, const
char* stringFormat,
286 virtual
void log(
Priority::Value priority,
287 const
std::
string& message) throw();
297 virtual
void logva(
Priority::Value priority,
298 const
char* stringFormat,
307 void debug(const
char* stringFormat, ...) throw();
313 void debug(const
std::
string& message) throw();
337 void info(
const char* stringFormat, ...) throw();
343 void info(const
std::
string& message) throw();
367 void notice(
const char* stringFormat, ...) throw();
373 void notice(const
std::
string& message) throw();
397 void warn(
const char* stringFormat, ...) throw();
403 void warn(const
std::
string& message) throw();
427 void error(
const char* stringFormat, ...) throw();
433 void error(const
std::
string& message) throw();
457 void crit(
const char* stringFormat, ...) throw();
463 void crit(const
std::
string& message) throw();
487 void alert(
const char* stringFormat, ...) throw();
493 void alert(const
std::
string& message) throw();
517 void emerg(
const char* stringFormat, ...) throw();
523 void emerg(const
std::
string& message) throw();
549 void fatal(
const char* stringFormat, ...) throw();
557 void fatal(const
std::
string& message) throw();
608 va_list arguments)
throw();
616 const std::string& message)
throw();
625 const std::string _name;
638 typedef std::map<Appender *, bool> OwnsAppenderMap;
646 virtual bool ownsAppender(
Appender* appender,
647 OwnsAppenderMap::iterator& i2)
throw();
657 OwnsAppenderMap _ownsAppender;
663 volatile bool _isAdditive;
#define LOG4SHIB_EXPORT
Definition Export.hh:11
Implement this interface for your own strategies for printing log statements.
Definition Appender.hh:33
This class enables streaming simple types and objects to a category.
Definition CategoryStream.hh:33
This is the central class in the log4j package.
Definition Category.hh:32
bool isNoticeEnabled() const
Return true if the Category will log messages with priority NOTICE.
Definition Category.hh:379
void setAppender(Appender &appender)
Adds an Appender for this Category.
Definition Category.hh:179
friend class HierarchyMaintainer
Definition Category.hh:33
CategoryStream warnStream()
Return a CategoryStream with priority WARN.
Definition Category.hh:417
CategoryStream critStream()
Return a CategoryStream with priority CRIT.
Definition Category.hh:477
static void setRootPriority(Priority::Value priority)
Set the priority of the root Category.
Definition Category.cpp:27
Category(const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)
Constructor.
Definition Category.cpp:52
CategoryStream emergStream()
Return a CategoryStream with priority EMERG.
Definition Category.hh:537
CategoryStream debugStream()
Return a CategoryStream with priority DEBUG.
Definition Category.hh:327
virtual Priority::Value getChainedPriority() const
Starting from this Category, search the category hierarchy for a set priority and return it.
Definition Category.cpp:82
bool isFatalEnabled() const
Return true if the Category will log messages with priority FATAL.
Definition Category.hh:565
virtual CategoryStream getStream(Priority::Value priority)
Return a CategoryStream with given Priority.
Definition Category.cpp:415
static Category & getRoot()
Return the root of the Category hierarchy.
Definition Category.cpp:23
CategoryStream noticeStream()
Return a CategoryStream with priority NOTICE.
Definition Category.hh:387
virtual void removeAllAppenders()
Removes all appenders for this Category.
Definition Category.cpp:149
CategoryStream alertStream()
Return a CategoryStream with priority ALERT.
Definition Category.hh:507
CategoryStream errorStream()
Return a CategoryStream with priority ERROR.
Definition Category.hh:447
static Category & getInstance(const std::string &name)
Instantiate a Category with name name.
Definition Category.cpp:35
bool isDebugEnabled() const
Return true if the Category will log messages with priority DEBUG.
Definition Category.hh:319
CategoryStream infoStream()
Return a CategoryStream with priority INFO.
Definition Category.hh:357
virtual Priority::Value getPriority() const
Returns the assigned Priority, if any, for this Category.
Definition Category.cpp:67
virtual bool isPriorityEnabled(Priority::Value priority) const
Returns true if the chained priority of the Category is equal to or higher than given priority.
Definition Category.cpp:261
static std::vector< Category * > * getCurrentCategories()
Returns all the currently defined categories as a vector of Category pointers.
Definition Category.cpp:43
bool isEmergEnabled() const
Return true if the Category will log messages with priority EMERG.
Definition Category.hh:529
virtual void addAppender(Appender *appender)
Adds an Appender to this Category.
Definition Category.cpp:93
bool isWarnEnabled() const
Return true if the Category will log messages with priority WARN.
Definition Category.hh:409
static Priority::Value getRootPriority()
Get the priority of the root Category.
Definition Category.cpp:31
CategoryStream fatalStream()
Return a CategoryStream with priority FATAL.
Definition Category.hh:575
static void shutdown()
This method will remove all Appenders from Categories.XXX.
Definition Category.cpp:48
bool isErrorEnabled() const
Return true if the Category will log messages with priority ERROR.
Definition Category.hh:439
virtual void setPriority(Priority::Value priority)
Set the priority of this Category.
Definition Category.cpp:71
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
bool isAlertEnabled() const
Return true if the Category will log messages with priority ALERT.
Definition Category.hh:499
void setAppender(Appender *appender)
Adds an Appender to this Category.
Definition Category.hh:165
virtual const std::string & getName() const
Return the category name.
Definition Category.cpp:63
bool isInfoEnabled() const
Return true if the Category will log messages with priority INFO.
Definition Category.hh:349
virtual Appender * getAppender() const
Returns the first Appender for this Category, or NULL if no Appender has been set.
Definition Category.cpp:120
bool ownsAppender() const
Returns true if the Category owns the first Appender in its Appender set.
Definition Category.hh:223
bool isCritEnabled() const
Return true if the Category will log messages with priority CRIT.
Definition Category.hh:469
The Priority class provides importance levels with which one can categorize log messages.
Definition Priority.hh:62
@ EMERG
Definition Priority.hh:69
@ WARN
Definition Priority.hh:74
@ NOTSET
Definition Priority.hh:78
@ ERROR
Definition Priority.hh:73
@ FATAL
Definition Priority.hh:70
@ ALERT
Definition Priority.hh:71
@ DEBUG
Definition Priority.hh:77
@ CRIT
Definition Priority.hh:72
@ NOTICE
Definition Priority.hh:75
@ INFO
Definition Priority.hh:76
int Value
The type of Priority Values.
Definition Priority.hh:84
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:147
Definition Portability.hh:37
The internal representation of logging events.
Definition LoggingEvent.hh:32