LOG4SHIB::STRINGQUEUEAPPENDER(3)
π NAME π
okay bestie, welcome to the log4shib::StringQueueAppender(3) page in the Library Functions Manual β it's all about the class that puts log messages in an in-memory queue. No cap. It's giving tiny queue, big main character energy π.
β¨ SYNOPSIS β¨
#include <StringQueueAppender.hh>
Inherits log4shib::LayoutAppender.
π Public Member Functions π
StringQueueAppender (const std::string &name)β the constructor, obviously.virtual ~StringQueueAppender ()β the destructor; it's virtual, bestie.virtual bool reopen ()β reopens the output destination of thisAppender, e.g. the logfile or TCP socket.virtual void close ()β release any resources allocated within the appender such as file handles, network connections, etc.virtual size_t queueSize () constβ return the current size of the message queue.virtual std::queue< std::string > & getQueue ()β return the queue to which theAppendsadds messages.virtual const std::queue< std::string > & getQueue () constβ same queue but const; return the queue to which theAppendsadds messages.virtual std::string popMessage ()β pop the oldest log message from the front of the queue.
π«Ά Public Member Functions inherited from log4shib::LayoutAppender π«Ά
LayoutAppender (const std::string &name)β constructor.virtual ~LayoutAppender ()β destructor.virtual bool requiresLayout () constβ check if the appender requires a layout.virtual void setLayout (Layout *layout=NULL)β set theLayoutfor this appender. Yes, the default isNULL.
π Public Member Functions inherited from log4shib::AppenderSkeleton π
virtual ~AppenderSkeleton ()β destructor forAppenderSkeleton.virtual void doAppend (const LoggingEvent &event)β log inAppenderspecific way.virtual void setThreshold (Priority::Value priority)β set the threshold priority of thisAppender.virtual Priority::Value getThreshold ()β get the threshold priority of thisAppender.virtual void setFilter (Filter *filter)β set aFilterfor this appender.virtual Filter * getFilter ()β get theFilterfor this appender.
π Public Member Functions inherited from log4shib::Appender π
virtual ~Appender ()β destructor forAppender.const std::string & getName () constβ get the name of this appender.
π Protected Member Functions π
virtual void _append (const LoggingEvent &event)β appends theLoggingEventto the queue.
π Protected Member Functions inherited from log4shib::LayoutAppender π
Layout & _getLayout ()β return the layout of the appender.
π¦ Protected Member Functions inherited from log4shib::AppenderSkeleton π¦
AppenderSkeleton (const std::string &name)β constructor forAppenderSkeleton.
π Protected Member Functions inherited from log4shib::Appender π
Appender (const std::string &name)β constructor forAppender.
π§ Protected Attributes π§
std::queue< std::string > _queueβ the protected queue attribute.
β Additional Inherited Members β
π Public Types inherited from log4shib::LayoutAppender π
typedef BasicLayout DefaultLayoutTypeβ the default layout type.
π Static Public Member Functions inherited from log4shib::Appender π
static Appender * getAppender (const std::string &name)β get a pointer to an exitsingAppender.static bool reopenAll ()β callreopen()on all existingAppenders.static void closeAll ()β callreopen()on all existingAppenders. Yes, the original literally saysreopen()here even though it'scloseAll()β I'm just the messenger π .
πΈ 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.
Since: 0.2.4
π Constructor & Destructor Documentation π
log4shib::StringQueueAppender::StringQueueAppender (const std::string & name)
The constructor. The signature is the whole story here.
log4shib::StringQueueAppender::~StringQueueAppender () [virtual]
The virtual destructor.
π Member Function Documentation π
void log4shib::StringQueueAppender::_append (const LoggingEvent & event) [protected], [virtual]
Appends the LoggingEvent to the queue.
Parameters:
eventβ theLoggingEventto layout and append to the queue.
Implements: log4shib::AppenderSkeleton.
void log4shib::StringQueueAppender::close () [virtual]
Release any resources allocated within the appender such as file handles, network connections, etc.
Implements: log4shib::AppenderSkeleton.
std::queue< std::string > & log4shib::StringQueueAppender::getQueue () [virtual]
Return the queue to which the Appends adds messages.
Returns: the message queue.
const std::queue< std::string > & log4shib::StringQueueAppender::getQueue () const [virtual]
Return the queue to which the Appends adds messages.
Returns: the message queue.
std::string log4shib::StringQueueAppender::popMessage () [virtual]
Pop the oldest log message from the front of the queue.
Returns: the oldest log message.
size_t log4shib::StringQueueAppender::queueSize () const [virtual]
Return the current size of the message queue. Shorthand for getQueue().size().
Returns: the queue size.
bool log4shib::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.
Reimplemented from: log4shib::AppenderSkeleton.
π Member Data Documentation π
std::queue<std::string> log4shib::StringQueueAppender::_queue [protected]
The protected queue data member. That's the whole vibe β it's the queue.
π Author π
Generated automatically by Doxygen for log4shib from the source code.
xoxo, bestie π β source/version: log4shib, Version 2.0.1, page: log4shib::StringQueueAppender(3). Date: the original footer didn't show one, so I'm not inventing one β periodt π«Άβ¨.
π¦ 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