log4shib::Category(3)
πΈ NAME πΈ
okay so this page is log4shib::Category(3) from the Library Functions Manual, and it's about log4shib::Category β literally the central class in the log4j package. main character energy, no cap π
β¨ SYNOPSIS β¨
#include <Category.hh>
Inherited by log4shib::FixedContextCategory.
π Public Member Functions π
virtual ~Category ()β the destructor for Category. bye bestie π«Άvirtual const std::string & getName () const throw ()β hands you back the category name. it's a const ref, she's not giving you a copy.virtual void setPriority (Priority::Value priority)β sets the priority of this Category.virtual Priority::Value getPriority () const throw ()β gives you the Priority that's been assigned to this Category, if any.virtual Priority::Value getChainedPriority () const throw ()β starts at this Category and climbs the category hierarchy looking for a set priority, then returns it. it's giving search-up-the-family-tree.virtual bool isPriorityEnabled (Priority::Value priority) const throw ()βtruewhen the chained priority of the Category is equal to or higher than the priority you passed in.virtual void addAppender (Appender *appender)β adds an Appender to this Category.virtual void addAppender (Appender &appender)β adds an Appender for this Category.void setAppender (Appender *appender)β adds an Appender to this Category.void setAppender (Appender &appender)β adds an Appender for this Category.virtual Appender * getAppender () constβ returns the first Appender for this Category, orNULLif no Appender has been set.virtual Appender * getAppender (const std::string &name) constβ returns the Appender you named for this Category, orNULLif that Appender isn't attached to this Category. sad but true πvirtual AppenderSet getAllAppenders () constβ returns the set of Appenders currently attached to this Catogory. (that spelling is theirs, not mine π)virtual void removeAllAppenders ()β removes every appender for this Category. clean slate era.virtual void removeAppender (Appender *appender)β removes the specified appender for this Category.bool ownsAppender () const throw ()βtrueif the Category owns the first Appender in its Appender set.virtual bool ownsAppender (Appender *appender) const throw ()βtrueif the Category owns that Appender.virtual void callAppenders (const LoggingEvent &event) throw ()β calls the appenders in the hierarchy, starting at this one.virtual void setAdditivity (bool additivity)β sets the additivity flag for this Category instance.virtual bool getAdditivity () const throw ()β returns the additivity flag for this Category instance.virtual Category * getParent () throw ()β returns the parent category of this category, orNULLif this category is the root category.virtual const Category * getParent () const throw ()β same deal, const flavour: the parent category, orNULLif this is the root category.virtual void log (Priority::Value priority, const char *stringFormat,...) throw ()β logs a message with the priority you specify.virtual void log (Priority::Value priority, const std::string &message) throw ()β logs a message with the priority you specify. string edition.virtual void logva (Priority::Value priority, const char *stringFormat, va_list va) throw ()β logs a message with the priority you specify,va_liststyle.void debug (const char *stringFormat,...) throw ()β logs a message with debug priority.void debug (const std::string &message) throw ()β logs a message with debug priority.bool isDebugEnabled () const throw ()βtrueif the Category will log messages with priority DEBUG.CategoryStream debugStream ()β returns a CategoryStream with priority DEBUG.void info (const char *stringFormat,...) throw ()β logs a message with info priority.void info (const std::string &message) throw ()β logs a message with info priority.bool isInfoEnabled () const throw ()βtrueif the Category will log messages with priority INFO.CategoryStream infoStream ()β returns a CategoryStream with priority INFO.void notice (const char *stringFormat,...) throw ()β logs a message with notice priority.void notice (const std::string &message) throw ()β logs a message with notice priority.bool isNoticeEnabled () const throw ()βtrueif the Category will log messages with priority NOTICE.CategoryStream noticeStream ()β returns a CategoryStream with priority NOTICE.void warn (const char *stringFormat,...) throw ()β logs a message with warn priority.void warn (const std::string &message) throw ()β logs a message with warn priority.bool isWarnEnabled () const throw ()βtrueif the Category will log messages with priority WARN.CategoryStream warnStream ()β returns a CategoryStream with priority WARN.void error (const char *stringFormat,...) throw ()β logs a message with error priority.void error (const std::string &message) throw ()β logs a message with error priority.bool isErrorEnabled () const throw ()βtrueif the Category will log messages with priority ERROR.CategoryStream errorStream ()β returns a CategoryStream with priority ERROR.void crit (const char *stringFormat,...) throw ()β logs a message with crit priority.void crit (const std::string &message) throw ()β logs a message with crit priority.bool isCritEnabled () const throw ()βtrueif the Category will log messages with priority CRIT.CategoryStream critStream ()β returns a CategoryStream with priority CRIT.void alert (const char *stringFormat,...) throw ()β logs a message with alert priority.void alert (const std::string &message) throw ()β logs a message with alert priority.bool isAlertEnabled () const throw ()βtrueif the Category will log messages with priority ALERT.CategoryStream alertStream () throw ()β returns a CategoryStream with priority ALERT. (not me noticing this is the only*Streamwith athrow ()β¦ π)void emerg (const char *stringFormat,...) throw ()β logs a message with emerg priority.void emerg (const std::string &message) throw ()β logs a message with emerg priority.bool isEmergEnabled () const throw ()βtrueif the Category will log messages with priority EMERG.CategoryStream emergStream ()β returns a CategoryStream with priority EMERG.void fatal (const char *stringFormat,...) throw ()β logs a message with fatal priority.void fatal (const std::string &message) throw ()β logs a message with fatal priority.bool isFatalEnabled () const throw ()βtrueif the Category will log messages with priority FATAL.CategoryStream fatalStream ()β returns a CategoryStream with priority FATAL.virtual CategoryStream getStream (Priority::Value priority)β returns a CategoryStream with the given Priority.virtual CategoryStream operator<< (Priority::Value priority)β returns a CategoryStream with the given Priority. operator energy β¨
π Static Public Member Functions π
static Category & getRoot ()β returns the root of the Category hierarchy.static void setRootPriority (Priority::Value priority)β sets the priority of the root Category.static Priority::Value getRootPriority () throw ()β gets the priority of the root Category.static Category & getInstance (const std::string &name)β instantiates a Category with the namename.static Category * exists (const std::string &name)β if the named category exists (in the default hierarchy) then you get a reference to the category, otherwise you getNULL. vibe check on your category π«Άstatic std::vector< Category * > * getCurrentCategories ()β returns every currently defined category as a vector of Category pointers.static void shutdown ()β this method will remove all Appenders from Categories.XXX.
π«Ά Protected Member Functions π«Ά
Category (const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET)β the Constructor.virtual void _logUnconditionally (Priority::Value priority, const char *format, va_list arguments) throw ()β theva_listone.virtual void _logUnconditionally2 (Priority::Value priority, const std::string &message) throw ()β unconditionally logs a message with the specified priority.
π§ Friends π§
class HierarchyMaintainerβ yes bestie, it's in the group chat π
π¦ Detailed Description π¦
This is the central class in the log4j package.
One of the distintive features of log4j (and hence log4shib) are hierarchal categories and their evaluation. (the spelling of distintive and hierarchal is copied straight from the source, don't come for me π)
π Constructor & Destructor Documentation π
log4shib::Category::~Category () [virtual]
Destructor for Category.
log4shib::Category::Category (const std::string & name, Category * parent, Priority::Value priority = Priority::NOTSET) [protected]
Constructor.
Parameters:
nameβ the fully qualified name of this Categoryparentβ the parent of this parent, orNULLfor the root Categorypriorityβ the priority for this Category. Defaults toPriority::NOTSET
π₯ Member Function Documentation π₯
void log4shib::Category::_logUnconditionally (Priority::Value priority, const char * format, va_list arguments) [protected], [virtual]
void log4shib::Category::_logUnconditionally2 (Priority::Value priority, const std::string & message) [protected], [virtual]
Unconditionally logs a message with the specified priority.
Parameters:
priorityβ The priority of this log message.messageβ string to write in the log file
Reimplemented in log4shib::FixedContextCategory.
void log4shib::Category::addAppender (Appender & appender) [virtual]
Adds an Appender for this Category. This method does not pass ownership from the caller to the Category.
Since: 0.2.7
Parameters:
appenderβ The Appender this category has to log to.
Reimplemented in log4shib::FixedContextCategory.
void log4shib::Category::addAppender (Appender * appender) [virtual]
Adds an Appender to this Category. This method does pass ownership from the caller to the Category.
Since: 0.2.7
Parameters:
appenderβ The Appender to wich this category has to log. (their spelling again, i'm innocent π)
Exceptions:
std::invalid_argumentif the appender isNULL.
Reimplemented in log4shib::FixedContextCategory.
void log4shib::Category::alert (const char * stringFormat, ...)
Logs a message with alert priority.
Parameters:
stringFormatβ Format specifier for the string to write in the log file....β The arguments for stringFormat
void log4shib::Category::alert (const std::string & message)
Logs a message with alert priority.
Parameters:
messageβ string to write in the log file
CategoryStream log4shib::Category::alertStream () [inline]
Returns a CategoryStream with priority ALERT.
Returns: The CategoryStream.
part 2 is literally right there, don't go anywhere bestie π¦β¨
π
void log4shib::Category::callAppenders (const LoggingEvent & event) β [virtual]
Okay so bestie, this one sends it. It calls the appenders up the whole hierarchy starting right here at this category, and if there are literally no appenders to be found anywhere, it emits a warning. π«Ά
Major thing to know: this method always calls all the appenders inherited from the hierarchy, no cap β it just straight up circumvents any evaluation of whether to log or not to log the particular log request. It doesn't check the vibe first, it just goes. π
Parameters
eventβ theLogginEventto log.
Reimplemented in log4shib::FixedContextCategory.
πΈ void log4shib::Category::crit (const char * stringFormat, ...)
Logs a message with crit priority. Yelling, but in a cunty way. π
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π¦ void log4shib::Category::crit (const std::string & message)
Same energy, but you're handing it a std::string.
Parameters
messageβ string to write in the log file
β¨ CategoryStream log4shib::Category::critStream () β [inline]
Hands you back a CategoryStream with priority CRIT. Stream it, queen. π
Returns
- The
CategoryStream.
π void log4shib::Category::debug (const char * stringFormat, ...)
Log a message with debug priority. Little baby sentences for the girlies who need all the details. π
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π§ void log4shib::Category::debug (const std::string & message)
Debug, but with a std::string this time.
Parameters
messageβ string to write in the log file
β CategoryStream log4shib::Category::debugStream () β [inline]
Returns a CategoryStream with priority DEBUG.
Returns
- The
CategoryStream.
π₯ void log4shib::Category::emerg (const char * stringFormat, ...)
Log a message with emerg priority. This is the the building is on fire one, bestie. Literally the emergency-est. π¨
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π void log4shib::Category::emerg (const std::string & message)
Same priority, std::string flavoured.
Parameters
messageβ string to write in the log file
π CategoryStream log4shib::Category::emergStream () β [inline]
Returns a CategoryStream with priority EMERG.
Returns
- The
CategoryStream.
π void log4shib::Category::error (const char * stringFormat, ...)
Log a message with error priority. You know the vibe β something's broken and we're being dramatic about it. π
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π void log4shib::Category::error (const std::string & message)
The std::string version of the same thing.
Parameters
messageβ string to write in the log file
π«Ά CategoryStream log4shib::Category::errorStream () β [inline]
Returns a CategoryStream with priority ERROR.
Returns
- The
CategoryStream.
π Category * log4shib::Category::exists (const std::string & name) β [static]
Vibe check on a category name! π
If the named category exists (in the default hierarchy) then it returns a reference to the category, otherwise it returns NULL. That's it, that's the whole girl.
Since 0.2.7
π₯ void log4shib::Category::fatal (const char * stringFormat, ...)
Log a message with fatal priority. NB. priority 'fatal' is equivalent to 'emerg' β they're the same girl, different outfit. π
Since 0.2.7
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π¦ void log4shib::Category::fatal (const std::string & message)
Log a message with fatal priority. NB. priority 'fatal' is equivalent to 'emerg'.
Since 0.2.7
Parameters
messageβ string to write in the log file
β¨ CategoryStream log4shib::Category::fatalStream () β [inline]
Returns a CategoryStream with priority FATAL. NB. priority 'fatal' is equivalent to 'emerg' β yes we're saying it again, no cap. π
Since 0.2.7
Returns
- The
CategoryStream.
πΈ bool log4shib::Category::getAdditivity () const β [virtual]
Returns the additivity flag for this Category instance. Is she additive? Enquiring minds. π
Reimplemented in log4shib::FixedContextCategory.
π AppenderSet log4shib::Category::getAllAppenders () const β [virtual]
Returns the set of Appenders currently attached to this Catogory β yes that's how it's spelled in the docs, bless. π You get all of them.
Since 0.3.1
Returns
- The set of attached
Appenders.
Reimplemented in log4shib::FixedContextCategory.
π«Ά Appender * log4shib::Category::getAppender () const β [virtual]
Returns the first Appender for this Category, or NULL if no Appender has been set.
Deprecated β use getAppender(const std::string&) instead, bestie. This one's giving legacy code energy. π
Returns
- The
Appender.
Reimplemented in log4shib::FixedContextCategory.
π Appender * log4shib::Category::getAppender (const std::string & name) const β [virtual]
Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category. Name-specific, iconic, the upgrade we deserved. β¨
Since 0.2.7
Returns
- The
Appender.
Reimplemented in log4shib::FixedContextCategory.
π¦ Priority::Value log4shib::Category::getChainedPriority () const β [virtual]
Starting from this Category, search the category hierarchy for a set priority and return it. Otherwise, return the priority of the root category. Climb the tree, girl. π³
The Category class is designed so that this method executes as quickly as possible β she's fast, she's optimised, she's that girl. π₯
Reimplemented in log4shib::FixedContextCategory.
π std::vector< Category * > * log4shib::Category::getCurrentCategories () β [static]
Returns all the currently defined categories as a vector of Category pointers. β οΈ Note: this function does not pass ownership of the categories in the vector to the caller β only the ownership of the vector. But, and I cannot stress this enough, vector<Category&>* is not legal C++, so we can't follow the default ownership conventions. It's giving "the language said no". π
Unlike in log4j, the root category is included in the returned set. We're inclusive here. π«Ά
Since 0.3.2. Before 0.3.2 this method returned a std::set
β Category & log4shib::Category::getInstance (const std::string & name) β [static]
Instantiate a Category with name name. This method does not set the priority of the category β which is by default Priority::NOTSET. So don't come for her about priorities, she literally has none set. π
Parameters
nameβ The name of the category to retrieve.
π const std::string & log4shib::Category::getName () const β [virtual]
Return the category name. Short, sweet, to the point. Name check: passed. β
Returns
- The category name.
πΈ Category * log4shib::Category::getParent () β [virtual]
Returns the parent category of this category, or NULL if the category is the root category. Root has no mother, she is the mother. π
Returns
- the parent category.
πΈ const Category * log4shib::Category::getParent () const β [virtual]
Same thing but const β the respectful version. Returns the parent category of this category, or NULL if the category is the root category.
Returns
- the parent category.
π Priority::Value log4shib::Category::getPriority () const β [virtual]
Returns the assigned Priority, if any, for this Category. Note the "if any" β she might be Priority::NOTSET and that's valid.
Returns
Priorityβ the assignedPriority, can bePriority::NOTSET
Reimplemented in log4shib::FixedContextCategory.
π Category & log4shib::Category::getRoot () β [static]
Return the root of the Category hierarchy. The root category is always instantiated and available. It's name is the empty string β literally "", the void, the origin, the mother. π
Unlike in log4j, calling Category.getInstance("") does retrieve the root category and not a category just under root named "". Important distinction, bestie, write it down. π
Returns
- The root category
β Priority::Value log4shib::Category::getRootPriority () β [static]
Get the priority of the root Category. Simple as.
Returns
- the priority of the root category
π CategoryStream log4shib::Category::getStream (Priority::Value priority) β [virtual]
Return a CategoryStream with given Priority. You pick the priority, she builds you the stream. Custom order, main character service. π
Parameters
priorityβ ThePriorityof theCategoryStream.
Returns
- The requested
CategoryStream.
π¦ void log4shib::Category::info (const char * stringFormat, ...)
Log a message with info priority. The "just so you know" of log levels. π«Ά
Parameters
stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π void log4shib::Category::info (const std::string & message)
Same, with a std::string.
Parameters
messageβ string to write in the log file
β¨ CategoryStream log4shib::Category::infoStream () β [inline]
Returns a CategoryStream with priority INFO.
Returns
- The
CategoryStream.
π§ bool log4shib::Category::isAlertEnabled () const β [inline]
Return true if the Category will log messages with priority ALERT. π¨
Returns
- Whether the
Categorywill log.
π bool log4shib::Category::isCritEnabled () const β [inline]
Return true if the Category will log messages with priority CRIT.
Returns
- Whether the
Categorywill log.
π bool log4shib::Category::isDebugEnabled () const β [inline]
Return true if the Category will log messages with priority DEBUG.
Returns
- Whether the
Categorywill log.
π¨ bool log4shib::Category::isEmergEnabled () const β [inline]
Return true if the Category will log messages with priority EMERG.
Returns
- Whether the
Categorywill log.
π bool log4shib::Category::isErrorEnabled () const β [inline]
Return true if the Category will log messages with priority ERROR.
Returns
- Whether the
Categorywill log.
π bool log4shib::Category::isFatalEnabled () const β [inline]
Return true if the Category will log messages with priority FATAL. NB. priority 'fatal' is equivalent to 'emerg' β yes, again. It's the same girl!! π₯
Since 0.2.7
Returns
- Whether the
Categorywill log.
π«Ά bool log4shib::Category::isInfoEnabled () const β [inline]
Return true if the Category will log messages with priority INFO.
Returns
- Whether the
Categorywill log.
πΈ bool log4shib::Category::isNoticeEnabled () const β [inline]
Return true if the Category will log messages with priority NOTICE.
Returns
- Whether the
Categorywill log.
β bool log4shib::Category::isPriorityEnabled (Priority::Value priority) const β [virtual]
Returns true if the chained priority of the Category is equal to or higher than the given priority. Chained, bestie β the inherited one, not just the local one. π³
Parameters
priorityβ The priority to compare with.
Returns
- whether logging is enable for this priority.
π bool log4shib::Category::isWarnEnabled () const β [inline]
Return true if the Category will log messages with priority WARN. β οΈ
Returns
- Whether the
Categorywill log.
π₯ void log4shib::Category::log (Priority::Value priority, const char * stringFormat, ...) β [virtual]
Log a message with the specified priority. The general-purpose one β you bring the priority, she brings the logging. π
Parameters
priorityβ The priority of this log message.stringFormatβ Format specifier for the string to write in the log file....β The arguments forstringFormat
π¦ void log4shib::Category::log (Priority::Value priority, const std::string & message) β [virtual]
Log a message with the specified priority, std::string edition.
Parameters
priorityβ The priority of this log message.messageβ string to write in the log file
π void log4shib::Category::logva (Priority::Value priority, const char * stringFormat, va_list va) β [virtual]
Log a message with the specified priority. The va_list one β for when you've already got your args all packed up in a little bag. π
Since 0.2.7
β¨ Parameters β¨
priorityβ the priority of this log message, like how urgent it is πstringFormatβ the format specifier for the string that's gonna get written into the log filevaβ the args forstringFormat
void log4shib::Category::notice (const char * stringFormat, ...)
Logs a message with notice priority π
Parameters
stringFormatβ the format specifier for the string that gets written in the log file...β the arguments forstringFormat
void log4shib::Category::notice (const std::string & message)
Same notice-energy, but you hand it a string π
Parameters
messageβ the string to write in the log file
CategoryStream log4shib::Category::noticeStream () [inline]
Hands you back a CategoryStream that's rocking priority NOTICE β
Returns
The CategoryStream, bestie. That's it. That's the return.
CategoryStream log4shib::Category::operator<< (Priority::Value priority) [virtual]
Returns a CategoryStream with whatever Priority you pass in β this one's [virtual], so it's got main character energy π
Parameters
priorityβ thePriorityof theCategoryStream
Returns
The requested CategoryStream
bool log4shib::Category::ownsAppender () const [inline]
Returns true if the Category owns the first Appender in its Appender set π and if that's the case, the Category destructor is gonna delete that Appender.
Deprecated β use ownsAppender(Appender*) instead. Like, seriously, use the other one π
bool log4shib::Category::ownsAppender (Appender * appender) const [virtual]
Returns true if the Category owns the Appender you passed in. If it does, the Category destructor will delete that Appender ποΈβ¨
Since
0.2.7
Reimplemented in log4shib::FixedContextCategory
void log4shib::Category::removeAllAppenders () [virtual]
Removes, like, all the appenders for this Category. Every last one. Gone π
Reimplemented in log4shib::FixedContextCategory
void log4shib::Category::removeAppender (Appender * appender) [virtual]
Removes the one specific appender you point at for this Category π―
Since
0.2.7
void log4shib::Category::setAdditivity (bool additivity) [virtual]
Sets the additivity flag for this Category instance. Yep, that's the whole vibe π¦
Reimplemented in log4shib::FixedContextCategory
void log4shib::Category::setAppender (Appender & appender) [inline]
Adds an Appender for this Category β and heads up, this method does not pass ownership from the caller over to the Category π«Ά
Deprecated β use addAppender(Appender&) instead.
Parameters
appenderβ the Appender this category has to log to
void log4shib::Category::setAppender (Appender * appender) [inline]
Adds an Appender to this Category β and this version does pass ownership from the caller to the Category π
Deprecated β useaddAppender(Appender*)orremoveAllAppenders()instead.
Parameters
appenderβ the Appender this category has to log to, orNULLto remove the current Appenders
void log4shib::Category::setPriority (Priority::Value priority) [virtual]
Sets the priority of this Category π
Parameters
priorityβ the priority to set. UsePriority::NOTSETto let the category use its parent's priority as its effective priority.
Exceptions
std::invalid_argument β thrown if the caller tries to set Priority::NOTSET on the Root Category. Yeah, don't do that π
void log4shib::Category::setRootPriority (Priority::Value priority) [static]
Sets the priority of the root Category, and it's [static] so it's everyone's business πΈ
Parameters
priorityβ the new priority for the root Category
void log4shib::Category::shutdown () [static]
This method will remove all Appenders from Categories.XXX. That's the whole thing, no cap π
void log4shib::Category::warn (const char * stringFormat, ...)
Logs a message with warn priority β οΈβ¨
Parameters
stringFormatβ the format specifier for the string that gets written in the log file...β the arguments forstringFormat
void log4shib::Category::warn (const std::string & message)
Logs a message with warn priority, but the string version π
Parameters
messageβ the string to write in the log file
CategoryStream log4shib::Category::warnStream () [inline]
Returns a CategoryStream with priority WARN β for when you wanna stream your warnings in style π₯
Returns
The CategoryStream
π«Ά Friends And Related Symbol Documentation π«Ά
friend class HierarchyMaintainer [friend]β yes,HierarchyMaintaineris a friend of this class. Friendship bracelet secured π
Author
Generated automatically by Doxygen for log4shib from the source code. Not a human, just a very busy little doc generator doing its thing π€β¨
aaaand that's the whole page, bestie!! π this last bit came to you courtesy of the manpage footer itself: source is log4shib, Version 2.0.1, and you're reading log4shib::Category(3) β love that for us ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- opensuse-leap 16.0: liblog4shib-devel 2.0.1-160000.3.2 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms