log4cpp::S...ueAppender(3)

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

✨ 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 for getQueue().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 is NULL.

πŸŽ€ 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 the LoggingEvent to 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 () β€” calls reopen() on all existing Appenders.
  • static void closeAll () β€” calls reopen() on all existing Appenders. (Yes, it says reopen() in the original description for closeAll. 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 β€” the LoggingEvent to 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 to log4cpp Version 1.1 for the manpage vibes. Stay slay, keep your queues in memory, and remember: this footer was proudly served by the log4cpp::S...ueAppender(3) manual page. πŸ’…βœ¨πŸŽ€
πŸ“¦ where this page comes from