log4cpp::S...ueAppender(3)
β¨ NAME β¨
Okay so bestie, welcome to the Library Functions Manual! Today we're diving into log4cpp::StringQueueAppender β and it's literally the appender that puts your log messages in an in-memory queue. No cap, that's its whole thing. π
π¦ SYNOPSIS π¦
#include <StringQueueAppender.hh>
It inherits from log4cpp::LayoutAppender. Iconic lineage, honestly.
π Public Member Functions π
StringQueueAppender (const std::string &name)β constructor, takes a name, slay.virtual ~StringQueueAppender ()β destructor, does its cleanup thing.virtual bool reopen ()β reopens the output destination of this Appender, e.g. the logfile or TCP socket. (More deets below, bestie.)virtual void close ()β releases any resources allocated within the appender such as file handles, network connections, etc. Cleanup queen behavior.virtual size_t queueSize () constβ returns the current size of the message queue. Shorthand forgetQueue().size(), if you're curious.virtual std::queue< std::string > & getQueue ()β returns the queue to which the Appends adds messages. (Yes, it says "Appends" in the original, we're keeping it, lol.)virtual const std::queue< std::string > & getQueue () constβ the const version, returns the queue to which the Appends adds messages too.virtual std::string popMessage ()β pops the oldest log message from the front of the queue. Bye bye, oldest message! π
πΈ Public Member Functions inherited from log4cpp::LayoutAppender πΈ
LayoutAppender (const std::string &name)β constructor, takes a name.virtual ~LayoutAppender ()β destructor.virtual bool requiresLayout () constβ checks if the appender requires a layout. (It does, bestie.)virtual void setLayout (Layout *layout=NULL)β sets the Layout for this appender. Default isNULL.
π Public Member Functions inherited from log4cpp::AppenderSkeleton π
virtual ~AppenderSkeleton ()β destructor for AppenderSkeleton.virtual void doAppend (const LoggingEvent &event)β logs in an Appender-specific way. Vibe check on each event.virtual void setThreshold (Priority::Value priority)β sets the threshold priority of this Appender.virtual Priority::Value getThreshold ()β gets the threshold priority of this Appender.virtual void setFilter (Filter *filter)β sets a Filter for this appender.virtual Filter * getFilter ()β gets the Filter for this appender.
π Public Member Functions inherited from log4cpp::Appender π
virtual ~Appender ()β destructor for Appender.const std::string & getName () constβ gets the name of this appender. Name drop!
π Protected Member Functions π
virtual void _append (const LoggingEvent &event)β appends theLoggingEventto the queue. (More deets below.)
π§ Protected Member Functions inherited from log4cpp::LayoutAppender π§
Layout & _getLayout ()β returns the layout of the appender.
π Protected Member Functions inherited from log4cpp::AppenderSkeleton π
AppenderSkeleton (const std::string &name)β constructor for AppenderSkeleton.
π Protected Member Functions inherited from log4cpp::Appender π
Appender (const std::string &name)β constructor for Appender.
β Protected Attributes β
std::queue< std::string > _queueβ the actual queue, protected, living its best life.
π Additional Inherited Members π
Public Types inherited from log4cpp::LayoutAppender
typedef BasicLayout DefaultLayoutType
Static Public Member Functions inherited from log4cpp::Appender
static Appender * getAppender (const std::string &name)β gets a pointer to an existing Appender. (Typo in original: "exitsing". We keep it, bestie, character for character.)static bool reopenAll ()β callsreopen()on all existing Appenders.static void closeAll ()β callsreopen()on all existing Appenders. (Yes, it saysreopen()in the original description forcloseAll. That's what it says, we're not fixing it. π)
π₯ Detailed Description π₯
This class puts log messages in an in-memory queue.
Its primary use is in test cases, but it may be useful elsewhere as well. Ngl, it's lowkey giving "test helper but also main character energy."
Since: 0.2.4
π«Ά Constructor & Destructor Documentation π«Ά
log4cpp::StringQueueAppender::StringQueueAppender (const std::string &name)
Constructor. Takes a name. That's it. Simple. Iconic.
log4cpp::StringQueueAppender::~StringQueueAppender () [virtual]
Destructor. Virtual. Does the cleanup thing.
π Member Function Documentation π
void log4cpp::StringQueueAppender::_append (const LoggingEvent &event)
[protected], [virtual]
Appends the LoggingEvent to the queue.
Parameters:
eventβ theLoggingEventto layout and append to the queue.
Implements: log4cpp::AppenderSkeleton. Periodt.
void log4cpp::StringQueueAppender::close () [virtual]
Release any resources allocated within the appender such as file handles, network connections, etc.
Implements: log4cpp::AppenderSkeleton. Closing time, bestie. π
std::queue< std::string > & log4cpp::StringQueueAppender::getQueue () [virtual]
Return the queue to which the Appends adds messages.
Returns: the message queue. Obsessed with this getter.
const std::queue< std::string > & log4cpp::StringQueueAppender::getQueue () const [virtual]
Return the queue to which the Appends adds messages. (Const version, same vibe, just can't touch.)
Returns: the message queue.
std::string log4cpp::StringQueueAppender::popMessage () [virtual]
Pop the oldest log message from the front of the queue. Bye bestie! π
Returns: the oldest log message.
size_t log4cpp::StringQueueAppender::queueSize () const [virtual]
Return the current size of the message queue. Shorthand for getQueue().size().
Returns: the queue size.
bool log4cpp::StringQueueAppender::reopen () [virtual]
Reopens the output destination of this Appender, e.g. the logfile or TCP socket.
Returns: false if an error occured during reopening, true otherwise. (Typo "occured" is in the original, we keep it, no cap.)
Reimplemented from: log4cpp::AppenderSkeleton.
πΈ Member Data Documentation πΈ
std::queue<std::string> log4cpp::StringQueueAppender::_queue [protected]
The protected queue member. It's where the messages live. π
π Author π
Generated automatically by Doxygen for log4cpp from the source code. Not me writing this by hand, bestie β it's the robots.
And that's the whole page, fr fr! Shoutout tolog4cppVersion 1.1 for the manpage vibes. Stay slay, keep your queues in memory, and remember: this footer was proudly served by thelog4cpp::S...ueAppender(3)manual page. π β¨π
π¦ where this page comes from
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· 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