LOG4SHIB::STRINGQUEUEAPPENDER(3)

πŸ“¦ version 2.0.1, in opensuse-leap 16.0

πŸ’… 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 this Appender, 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 the Appends adds messages.
  • virtual const std::queue< std::string > & getQueue () const β€” same queue but const; return the queue to which the Appends adds 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 the Layout for this appender. Yes, the default is NULL.

πŸ’œ Public Member Functions inherited from log4shib::AppenderSkeleton πŸ’œ

  • virtual ~AppenderSkeleton () β€” destructor for AppenderSkeleton.
  • virtual void doAppend (const LoggingEvent &event) β€” log in Appender specific way.
  • virtual void setThreshold (Priority::Value priority) β€” set the threshold priority of this Appender.
  • virtual Priority::Value getThreshold () β€” get the threshold priority of this Appender.
  • virtual void setFilter (Filter *filter) β€” set a Filter for this appender.
  • virtual Filter * getFilter () β€” get the Filter for this appender.

πŸ‘‘ Public Member Functions inherited from log4shib::Appender πŸ‘‘

  • virtual ~Appender () β€” destructor for Appender.
  • const std::string & getName () const β€” get the name of this appender.

πŸŽ€ Protected Member Functions πŸŽ€

  • virtual void _append (const LoggingEvent &event) β€” appends the LoggingEvent to 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 for AppenderSkeleton.

πŸ“ Protected Member Functions inherited from log4shib::Appender πŸ“

  • Appender (const std::string &name) β€” constructor for Appender.

🧚 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 exitsing Appender.
  • static bool reopenAll () β€” call reopen() on all existing Appenders.
  • static void closeAll () β€” call reopen() on all existing Appenders. Yes, the original literally says reopen() here even though it's closeAll() β€” 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 β€” the LoggingEvent to 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 🫢✨.