log4cpp::Category(3)

πŸ“¦
version 1.1.4 Β· 4 versions
, in opensuse-leap 16.0

🌸 log4cpp::Category(3) β€” Library Functions Manual πŸŽ€

okay bestie, gather round, because this is the page. like, the main character of the whole log4cpp library. no cap. this is log4cpp::Category(3), and she is everything. πŸ’…


✨ NAME ✨

log4cpp::Category β€” this is the central class in the log4j package. that's it. that's the vibe. she's iconic, she's the hub, everyone reports to her. πŸ‘‘


✨ SYNOPSIS ✨

#include <Category.hh>

Inherited by log4cpp::FixedContextCategory. (yes, she has a daughter. proud mom moment. πŸ₯Ή)

πŸ’– Public Member Functions

  • virtual ~Category () β€” Destructor for Category.
  • virtual const std::string & getName () const LOG4CPP_NOTHROW β€” Return the category name.
  • virtual void setPriority (Priority::Value priority) β€” Set the priority of this Category.
  • virtual Priority::Value getPriority () const LOG4CPP_NOTHROW β€” Returns the assigned Priority, if any, for this Category.
  • virtual Priority::Value getChainedPriority () const LOG4CPP_NOTHROW β€” Starting from this Category, search the category hierarchy for a set priority and return it.
  • virtual bool isPriorityEnabled (Priority::Value priority) const LOG4CPP_NOTHROW β€” Returns true if the chained priority of the Category is equal to or higher than given priority.
  • 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, or NULL if no Appender has been set.
  • virtual Appender * getAppender (const std::string &name) const β€” Returns the specified Appender for this Category, or NULL if the Appender is not attached to this Category.
  • virtual AppenderSet getAllAppenders () const β€” Returns the set of Appenders currently attached to this Catogory. (that spelling is hers, don't @ me 🫢)
  • virtual void removeAllAppenders () β€” Removes all appenders for this Category.
  • virtual void removeAppender (Appender *appender) β€” Removes specified appender for this Category.
  • virtual bool ownsAppender () const LOG4CPP_NOTHROW β€” Returns true if the Category owns the first Appender in its Appender set.
  • virtual bool ownsAppender (Appender *appender) const LOG4CPP_NOTHROW β€” Returns true if the Category owns the Appender.
  • virtual void callAppenders (const LoggingEvent &event) LOG4CPP_NOTHROW β€” Call the appenders in the hierarchy starting at this.
  • virtual void setAdditivity (bool additivity) β€” Set the additivity flag for this Category instance.
  • virtual bool getAdditivity () const LOG4CPP_NOTHROW β€” Returns the additivity flag for this Category instance.
  • virtual Category * getParent () LOG4CPP_NOTHROW β€” Returns the parent category of this category, or NULL if the category is the root category.
  • virtual const Category * getParent () const LOG4CPP_NOTHROW β€” Returns the parent category of this category, or NULL if the category is the root category. (yes twin, same energy, const version πŸ’œ)
  • virtual void log (Priority::Value priority, const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with the specified priority.
  • virtual void log (Priority::Value priority, const std::string &message) LOG4CPP_NOTHROW β€” Log a message with the specified priority.
  • virtual void logva (Priority::Value priority, const char *stringFormat, va_list va) LOG4CPP_NOTHROW β€” Log a message with the specified priority.
  • void debug (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with debug priority.
  • void debug (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with debug priority.
  • bool isDebugEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority DEBUG.
  • CategoryStream debugStream () β€” Return a CategoryStream with priority DEBUG.
  • void info (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with info priority.
  • void info (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with info priority.
  • bool isInfoEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority INFO.
  • CategoryStream infoStream () β€” Return a CategoryStream with priority INFO.
  • void notice (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with notice priority.
  • void notice (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with notice priority.
  • bool isNoticeEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority NOTICE.
  • CategoryStream noticeStream () β€” Return a CategoryStream with priority NOTICE.
  • void warn (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with warn priority.
  • void warn (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with warn priority.
  • bool isWarnEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority WARN.
  • CategoryStream warnStream () β€” Return a CategoryStream with priority WARN.
  • void error (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with error priority.
  • void error (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with error priority.
  • bool isErrorEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority ERROR.
  • CategoryStream errorStream () β€” Return a CategoryStream with priority ERROR.
  • void crit (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with crit priority.
  • void crit (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with crit priority.
  • bool isCritEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority CRIT.
  • CategoryStream critStream () β€” Return a CategoryStream with priority CRIT.
  • void alert (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with alert priority.
  • void alert (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with alert priority.
  • bool isAlertEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority ALERT.
  • CategoryStream alertStream () LOG4CPP_NOTHROW β€” Return a CategoryStream with priority ALERT.
  • void emerg (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with emerg priority.
  • void emerg (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with emerg priority.
  • bool isEmergEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority EMERG.
  • CategoryStream emergStream () β€” Return a CategoryStream with priority EMERG.
  • void fatal (const char *stringFormat,...) LOG4CPP_NOTHROW β€” Log a message with fatal priority.
  • void fatal (const std::string &message) LOG4CPP_NOTHROW β€” Log a message with fatal priority.
  • bool isFatalEnabled () const LOG4CPP_NOTHROW β€” Return true if the Category will log messages with priority FATAL.
  • CategoryStream fatalStream () β€” Return a CategoryStream with priority FATAL.
  • virtual CategoryStream getStream (Priority::Value priority) β€” Return a CategoryStream with given Priority.
  • virtual CategoryStream operator<< (Priority::Value priority) β€” Return a CategoryStream with given Priority.

πŸ’œ Static Public Member Functions

  • static Category & getRoot () β€” Return the root of the Category hierarchy.
  • static void setRootPriority (Priority::Value priority) β€” Set the priority of the root Category.
  • static Priority::Value getRootPriority () LOG4CPP_NOTHROW β€” Get the priority of the root Category.
  • static Category & getInstance (const std::string &name) β€” Instantiate a Category with name name.
  • static Category * exists (const std::string &name) β€” If the named category exists (in the default hierarchy) then it returns a reference to the category, otherwise it returns NULL.
  • static std::vector< Category * > * getCurrentCategories () β€” Returns all the currently defined categories as a vector of Category pointers.
  • static void shutdown () β€” This method will remove all Appenders from Categories.XXX.
  • static void shutdownForced () β€” This method will remove all Appenders from Categories.XXX and delete all appenders.

πŸ¦‹ Protected Member Functions

  • Category (const std::string &name, Category *parent, Priority::Value priority=Priority::NOTSET) β€” Constructor.
  • virtual void _logUnconditionally (Priority::Value priority, const char *format, va_list arguments) LOG4CPP_NOTHROW
  • virtual void _logUnconditionally2 (Priority::Value priority, const std::string &message) LOG4CPP_NOTHROW β€” Unconditionally log a message with the specified priority.

🧚 Friends

  • class HierarchyMaintainer

🌈 Detailed Description

okay so. this is the central class in the log4j package. that's not me being dramatic, that's literally the description. she runs the whole thing. πŸ‘‘

One of the distintive features of log4j (and hence log4cpp) are hierarchal categories and their evaluation. (yes, "distintive" β€” she said what she said, and we love her for it 🫢)


πŸŽ€ Constructor & Destructor Documentation

log4cpp::Category::~Category () [virtual]

Destructor for Category. she's logging off. say goodbye, bestie. πŸ˜­πŸ’”

log4cpp::Category::Category (const std::string & name, Category * parent, Priority::Value priority = Priority::NOTSET) [protected]

Constructor. the birth of a whole icon, tbh. ✨

Parameters

  • name β€” the fully qualified name of this Category
  • parent β€” the parent of this parent, or NULL for the root Category
  • priority β€” the priority for this Category. Defaults to Priority::NOTSET

πŸ’… Member Function Documentation

void log4cpp::Category::_logUnconditionally (Priority::Value priority, const char * format, va_list arguments) [protected], [virtual]

void log4cpp::Category::_logUnconditionally2 (Priority::Value priority, const std::string & message) [protected], [virtual]

Unconditionally log a message with the specified priority. no vibe check, no filter, no nothing β€” it just goes. πŸ”₯

Parameters

  • priority β€” The priority of this log message.
  • message β€” string to write in the log file

Reimplemented in log4cpp::FixedContextCategory.

void log4cpp::Category::addAppender (Appender & appender) [virtual]

Adds an Appender for this Category. This method does not pass ownership from the caller to the Category. (so like, you still own it, bestie β€” she's just borrowing πŸ‘€)

Since 0.2.7

Parameters

  • appender β€” The Appender this category has to log to.

Reimplemented in log4cpp::FixedContextCategory.

void log4cpp::Category::addAppender (Appender * appender) [virtual]

Adds an Appender to this Category. This method passes ownership from the caller to the Category. (now she owns it. it's hers now. full custody. πŸ’…)

Since 0.2.7

Parameters

  • appender β€” The Appender to wich this category has to log. (yes, "wich". icon behaviour. πŸŽ€)

Exceptions

  • std::invalid_argument if the appender is NULL. bestie do NOT pass her a null pointer, she WILL throw. πŸ’€

Reimplemented in log4cpp::FixedContextCategory.

void log4cpp::Category::alert (const char * stringFormat, ...)

Log a message with alert priority.

Parameters

  • stringFormat β€” Format specifier for the string to write in the log file.
  • ... β€” The arguments for stringFormat

void log4cpp::Category::alert (const std::string & message)

Log a message with alert priority.

  • message β€” the string to write in the log file πŸ“

CategoryStream log4cpp::Category::alertStream () [inline]

Hands you a CategoryStream that's already set to priority ALERT πŸ’…

Returns β€” the CategoryStream. That's it, that's the whole vibe.


void log4cpp::Category::callAppenders (const LoggingEvent & event) [virtual]

Calls the appenders up the hierarchy, starting right here at this category. And if it can't find a single appender? It emits a warning. 🫢

Heads up bestie, this one always calls all the appenders inherited from the hierarchy β€” it fully circumvents any evaluation of whether to log or not to log that particular log request. No vibe check, no filter, it just sends it. πŸ”₯

Parameters

  • event β€” the LogginEvent to log. (yes, that spelling is in the source, we don't touch it ✨)

Reimplemented in log4cpp::FixedContextCategory.


void log4cpp::Category::crit (const char * stringFormat, ...)

Logs a message at crit priority. Iconic, dramatic, exactly what you want. 😭

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::crit (const std::string & message)

Same crit priority energy, but you're handing over a ready-made message. πŸŽ€

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::critStream () [inline]

Gives you a CategoryStream with priority CRIT.

Returns β€” the CategoryStream. πŸ’…


void log4cpp::Category::debug (const char * stringFormat, ...)

Logs a message at debug priority. For when you need to know everything. πŸ¦‹

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::debug (const std::string & message)

debug priority, but with a pre-built std::string message. 🌸

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::debugStream () [inline]

Returns a CategoryStream with priority DEBUG.

Returns β€” the CategoryStream. ✨


void log4cpp::Category::emerg (const char * stringFormat, ...)

Logs a message at emerg priority. Emergency mode, main character crisis, we're all here for it. πŸ’€

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::emerg (const std::string & message)

emerg priority with a std::string message, no formatting required. πŸ“

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::emergStream () [inline]

Returns a CategoryStream with priority EMERG.

Returns β€” the CategoryStream. 🚨


void log4cpp::Category::error (const char * stringFormat, ...)

Logs a message at error priority. Not great, not terrible, but definitely logged. 😭

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::error (const std::string & message)

error priority, with your message already assembled. πŸ’œ

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::errorStream () [inline]

Returns a CategoryStream with priority ERROR.

Returns β€” the CategoryStream. πŸ”₯


Category * log4cpp::Category::exists (const std::string & name) [static]

Vibe check on a category name πŸ‘€ β€” if a category with that name exists in the default hierarchy, you get a reference to it. Otherwise? You get NULL. That's the whole deal, no cap.

Since β€” 0.2.7


void log4cpp::Category::fatal (const char * stringFormat, ...)

Logs a message at fatal priority. NB. priority fatal is equivalent to emerg. πŸ’€

Since β€” 0.2.7

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::fatal (const std::string & message)

fatal priority, string-message edition. NB. priority fatal is equivalent to emerg. 😭

Since β€” 0.2.7

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::fatalStream () [inline]

Returns a CategoryStream with priority FATAL. NB. priority fatal is equivalent to emerg. 🫢

Since β€” 0.2.7

Returns β€” the CategoryStream.


bool log4cpp::Category::getAdditivity () const [virtual]

Returns the additivity flag for this Category instance. Has it inherited its parents' appenders or is it going solo? This tells you. ✨

Reimplemented in log4cpp::FixedContextCategory.


AppenderSet log4cpp::Category::getAllAppenders () const [virtual]

Returns the set of Appenders currently attached to this Catogory. (that typo is canon, bestie, we keep it πŸ’…)

Since β€” 0.3.1

Returns β€” the set of attached Appenders.

Reimplemented in log4cpp::FixedContextCategory.


Appender * log4cpp::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. Don't be that girl still calling the deprecated one, ok? πŸ₯²

Returns β€” the Appender.

Reimplemented in log4cpp::FixedContextCategory.


Appender * log4cpp::Category::getAppender (const std::string & name) const [virtual]

Returns the Appender you asked for by name, or NULL if that Appender isn't attached to this Category. The respectful, non-deprecated way to do it. πŸ‘‘

Since β€” 0.2.7

Returns β€” the Appender.

Reimplemented in log4cpp::FixedContextCategory.


Priority::Value log4cpp::Category::getChainedPriority () const [virtual]

Starts at this Category and walks up the category hierarchy looking for a set priority, then returns it. Nothing set anywhere? Then you get the priority of the root category. 🌈

And like β€” the Category class is literally designed so this method executes as quickly as possible. Speed. Main character efficiency. ⭐

Reimplemented in log4cpp::FixedContextCategory.


std::vector< Category * > * log4cpp::Category::getCurrentCategories () [static]

Returns every currently defined category as a vector of Category pointers. πŸ“‹

Read this part carefully, bestie, it's giving ownership rules πŸ”₯: this function does not pass ownership of the categories in the vector to the caller β€” only the ownership of the vector. But vector<Category&>* isn't legal C++, so the default ownership conventions couldn't be followed. Sad but true. 😭

And unlike in log4j, the root category is included in the returned set. Don't forget it. πŸŽ€

Since β€” 0.3.2. Before 0.3.2 this method returned a std::set.


Category & log4cpp::Category::getInstance (const std::string & name) [static]

Instantiates a Category named name. ✨ Important: this method does not set the priority of the category β€” it's Priority::NOTSET by default. It's a whole not-set situation. πŸ’…

Parameters

  • name β€” the name of the category to retrieve.

const std::string & log4cpp::Category::getName () const [virtual]

Returns the category name. Identity! πŸͺž

Returns β€” the category name.


const Category * log4cpp::Category::getParent () const [virtual]

Returns the parent category of this category, or NULL if this category is the root category. πŸ‘‘ (root has no parent β€” it's the parent)

Returns β€” the parent category.


Category * log4cpp::Category::getParent () [virtual]

The non-const twin 🫢 β€” returns the parent category of this category, or NULL if this category is the root category.

Returns β€” the parent category.


Priority::Value log4cpp::Category::getPriority () const [virtual]

Returns the priority that's been assigned to this Category, if there is one. πŸŽ€

Returns β€” Priority, the assigned Priority. And yes, it can be Priority::NOTSET.

Reimplemented in log4cpp::FixedContextCategory.


Category & log4cpp::Category::getRoot () [static]

Returns the root of the Category hierarchy. The root category is always instantiated and available, no setup needed. Its name is the empty string. πŸ«₯

And here's the log4j difference that lives rent free in my head: unlike in log4j, calling Category.getInstance("") does retrieve the root category β€” it does not give you a category just under root named "". ✨

Returns β€” the root category.


Priority::Value log4cpp::Category::getRootPriority () [static]

Gets the priority of the root Category. πŸ‘‘

Returns β€” the priority of the root category.


CategoryStream log4cpp::Category::getStream (Priority::Value priority) [virtual]

Returns a CategoryStream with whatever priority you hand it. Build-your-own-stream energy. πŸ¦‹

Parameters

  • priority β€” the Priority of the CategoryStream.

Returns β€” the requested CategoryStream.


void log4cpp::Category::info (const char * stringFormat, ...)

Logs a message at info priority. The bread and butter. 🍞

Parameters

  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::info (const std::string & message)

info priority, with a std::string you already made. 🌸

Parameters

  • message β€” the string to write in the log file.

CategoryStream log4cpp::Category::infoStream () [inline]

Returns a CategoryStream with priority INFO.

Returns β€” the CategoryStream. πŸ’œ


bool log4cpp::Category::isAlertEnabled () const [inline]

Returns true if the Category will log messages with priority ALERT. 🚨

Returns β€” whether the Category will log.


bool log4cpp::Category::isCritEnabled () const [inline]

Returns true if the Category will log messages with priority CRIT. 😭

Returns β€” whether the Category will log.


bool log4cpp::Category::isDebugEnabled () const [inline]

Returns true if the Category will log messages with priority DEBUG. πŸ¦‹

Returns β€” whether the Category will log.


bool log4cpp::Category::isEmergEnabled () const [inline]

Returns true if the Category will log messages with priority EMERG. πŸ’€

Returns β€” whether the Category will log.


bool log4cpp::Category::isErrorEnabled () const [inline]

Returns true if the Category will log messages with priority ERROR. πŸ”₯

Returns β€” whether the Category will log.


bool log4cpp::Category::isFatalEnabled () const [inline]

Returns true if the Category will log messages with priority FATAL. NB. priority fatal is equivalent to emerg. πŸ’€

Since β€” 0.2.7

Returns β€” whether the Category will log.


bool log4cpp::Category::isInfoEnabled () const [inline]

Returns true if the Category will log messages with priority INFO. ✨

Returns β€” whether the Category will log.


bool log4cpp::Category::isNoticeEnabled () const [inline]

Returns true if the Category will log messages with priority NOTICE. πŸŽ€

Returns β€” whether the Category will log.


bool log4cpp::Category::isPriorityEnabled (Priority::Value priority) const [virtual]

Returns true if the chained priority of the Category is equal to or higher than the priority you passed in. 🫢

Parameters

  • priority β€” the priority to compare with.

Returns β€” whether logging is enable for this priority. (yep, "enable", that's the source's word, we respect it πŸ’…)


bool log4cpp::Category::isWarnEnabled () const [inline]

Returns true if the Category will log messages with priority WARN. 🌈

Returns β€” whether the Category will log.


void log4cpp::Category::log (Priority::Value priority, const char * stringFormat, ...) [virtual]

Logs a message with the priority you specify β€” you're driving. πŸ”₯

Parameters

  • priority β€” the priority of this log message.
  • stringFormat β€” the format specifier for the string to write in the log file.
  • ... β€” the arguments for stringFormat.

void log4cpp::Category::log (Priority::Value priority, const std::string & message) [virtual]

Logs a message with the priority you specify, pre-formatted string style. πŸŽ€

Parameters

  • priority β€” the priority of this log message.
  • message β€” the string to write in the log file.

void log4cpp::Category::logva (Priority::Value priority, const char * stringFormat, va_list va) [virtual]

Logs a message with the priority you specify, va_list flavour β€” the one you use when you're already inside a variadic function and need to forward the args. 🧚

Since β€” 0.2.7

Parameters

  • priority β€” the priority of this log message, obvs. It's what decides whether the message actually makes it out alive 🫢
  • stringFormat β€” the format specifier for the string that gets written into the log file. Your template, bestie ✨
  • va β€” the arguments for stringFormat. All the lil fill-ins πŸŽ€

notice, notice, noticeStream 🌸

  • void log4cpp::Category::notice (const char * stringFormat, ...) β€” logs a message with notice priority.
    • stringFormat β€” format specifier for the string to write in the log file.
    • ... β€” the arguments for stringFormat.
  • void log4cpp::Category::notice (const std::string & message) β€” logs a message with notice priority.
    • message β€” the string to write in the log file.
  • CategoryStream log4cpp::Category::noticeStream () [inline] β€” hands you back a CategoryStream with priority NOTICE.
    • Returns β€” the CategoryStream. That's it, that's the whole vibe πŸ¦‹

operator<< πŸ’…

  • CategoryStream log4cpp::Category::operator<< (Priority::Value priority) [virtual] β€” returns a CategoryStream with whatever Priority you hand it. It's virtual, so it's giving main character energy in the inheritance department πŸ‘‘
    • priority β€” the Priority of the CategoryStream.
    • Returns β€” the requested CategoryStream.

ownsAppender (the messy one) 😭

  • virtual bool log4cpp::Category::ownsAppender () const [inline], [virtual] β€” returns true if the Category owns the first Appender in its Appender set. In that case the Category destructor will delete the Appender. No cap, that's the whole deal.
Deprecated β€” use ownsAppender(Appender*) instead. Like, please. The no-arg version is so 1.0 πŸ™ˆ
  • Reimplemented in log4cpp::FixedContextCategory.
  • bool log4cpp::Category::ownsAppender (Appender * appender) const [virtual] β€” returns true if the Category owns the Appender (the one you point at). In that case the Category destructor will delete the Appender. This is the glow-up version, use this one 🫢
    • Since β€” 0.2.7
    • Reimplemented in log4cpp::FixedContextCategory.

removeAllAppenders & removeAppender ✨

  • void log4cpp::Category::removeAllAppenders () [virtual] β€” removes all appenders for this Category. Yeet, gone, every single one πŸ’€
    • Reimplemented in log4cpp::FixedContextCategory.
  • void log4cpp::Category::removeAppender (Appender * appender) [virtual] β€” removes the specified appender for this Category. Just the one. Targeted yeet 🎯
    • Since β€” 0.2.7

setAdditivity 🧚

  • void log4cpp::Category::setAdditivity (bool additivity) [virtual] β€” sets the additivity flag for this Category instance. It's virtual, it's iconic, it's fine.
    • Reimplemented in log4cpp::FixedContextCategory.

setAppender, setAppender (yes, both, and yes, both deprecated) πŸ’€

  • void log4cpp::Category::setAppender (Appender & appender) [inline] β€” adds an Appender for this Category. Heads up: this method does not pass ownership from the caller to the Category. You keep the keys, bestie πŸ”‘
Deprecated β€” use addAppender(Appender&) instead.
  • appender β€” the Appender this category has to log to.
  • void log4cpp::Category::setAppender (Appender * appender) [inline] β€” adds an Appender to this Category. This one does pass ownership from the caller to the Category. So like, be sure you meant that πŸ™ˆ
Deprecated β€” use addAppender(Appender*) or removeAllAppenders() instead.
  • appender β€” the Appender this category has to log to or NULL to remove the current Appenders.

setPriority πŸ”₯

  • void log4cpp::Category::setPriority (Priority::Value priority) [virtual] β€” sets the priority of this Category.
    • priority β€” the priority to set. Use Priority::NOTSET to let the category use its parent's priority as its effective priority. Inheritance slay ✨
    • Exceptions β€” std::invalid_argument if the caller tries to set Priority::NOTSET on the Root Category.
Fr fr, do not try to set Priority::NOTSET on the Root Category. The Root has no parent to borrow a priority from, so it just throws std::invalid_argument at you 😭

setRootPriority ⭐

  • void log4cpp::Category::setRootPriority (Priority::Value priority) [static] β€” sets the priority of the root Category. Static, so you call it on the class, not on an instance. Big main-character-of-the-whole-hierarchy energy πŸ‘‘
    • priority β€” the new priority for the root Category.

shutdown & shutdownForced 🧨

  • void log4cpp::Category::shutdown () [static] β€” this method will remove all Appenders from Categories.XXX.
  • void log4cpp::Category::shutdownForced () [static] β€” this method will remove all Appenders from Categories.XXX and delete all appenders. It releases more memory than shutdown() by deleting the appenders. So, like β€” the nuclear option, but in a cute, memory-clean way πŸ’…

warn, warn, warnStream 🌈

  • void log4cpp::Category::warn (const char * stringFormat, ...) β€” logs a message with warn priority.
    • stringFormat β€” format specifier for the string to write in the log file.
    • ... β€” the arguments for stringFormat.
  • void log4cpp::Category::warn (const std::string & message) β€” logs a message with warn priority.
    • message β€” the string to write in the log file.
  • CategoryStream log4cpp::Category::warnStream () [inline] β€” returns a CategoryStream with priority WARN.
    • Returns β€” the CategoryStream. Stream it, bestie πŸ“

  • friend class HierarchyMaintainer [friend] β€” yeah, they're a friend of the class. That's the whole entry. Keep it in the group chat πŸ’œ

✨ Author ✨

Generated automatically by Doxygen for log4cpp from the source code. Like, nobody hand-wrote this and that's honestly iconic of Doxygen πŸŽ€


And that's a wrap, bestie! This little masterpiece is from log4cpp, Version 1.1, and you're reading log4cpp::Category(3) β€” go forth and log responsibly πŸ’–βœ¨πŸ‘‘

πŸ“¦ where this page comes from