log4tango::Appender(3)

πŸ“¦
version 9.3.4 Β· 2 versions
, in debian bookworm

πŸ’– log4tango::Appender πŸ’–

okay bestie, gather round, because today we're talking about log4tango::Appender β€” and yes this is the manual for it, page 3 of the log4tango manual, and honestly? she's kind of a big deal. 🫢


✨ NAME ✨

log4tango::Appender β€” the whole entire base-class moment. it's giving "abstract interface," it's giving "you literally cannot instantiate me," periodt. πŸ’…


🌈 SYNOPSIS 🌈

#include <Appender.hh>

Inherited by log4tango::LayoutAppender.

πŸ‘‘ Public Member Functions πŸ‘‘

  • virtual ~Appender() β€” the Destructor for Appender. she cleans up. iconic behaviour. ✨
  • int append(const LoggingEvent &event) β€” Log in Appender specific way.
  • virtual bool reopen(void) β€” Reopens the output destination of this Appender, e.g.
  • virtual void close(void)=0 β€” Release any resources allocated within the appender such as file handles, network connections, etc.
  • virtual bool requires_layout(void) const =0 β€” Check if the appender uses a layout.
  • virtual void set_layout(Layout *layout=0)=0 β€” Change the layout.
  • const std::string & get_name(void) const β€” Returns this appender name.
  • virtual bool is_valid(void) const β€” Check if the appender is valid (for instance the underlying connection is ok) This default implementation always return true.

πŸŽ€ Protected Member Functions πŸŽ€

  • Appender(const std::string &name) β€” Constructor for Appender.
  • virtual void level_changed(Level::Value new_level) β€” Inform an appender that its Logger's logging level has changed.
  • virtual int _append(const LoggingEvent &event)=0 β€” Log in Appender specific way.

πŸ¦‹ Friends πŸ¦‹

  • class Logger

🌸 Constructor & Destructor Documentation 🌸

log4tango::Appender::Appender (const std::string & name) [protected]

Constructor for Appender. Will only be used in getAppender() (and in derived classes of course). no cap, she's protected for a reason β€” you can't just summon her whenever, you gotta go through the family. πŸ’…

Parameters

  • name β€” The name of this Appender.

log4tango::Appender::~Appender () [virtual]

Destructor for Appender. bye queen, ty for your service. πŸ˜­πŸ’œ


⭐ Member Function Documentation ⭐

virtual int log4tango::Appender::_append (const LoggingEvent & event) [protected], [pure virtual]

Log in Appender specific way. Subclasses of Appender should implement this method to perform actual logging. like, this is the assignment bestie, you HAVE to do it, it's pure virtual, there is no default, there is no escape. 🫣

Parameters

  • event β€” The LoggingEvent to log.

Implemented in log4tango::FileAppender, log4tango::OstreamAppender, and log4tango::RollingFileAppender.


int log4tango::Appender::append (const LoggingEvent & event) [inline]

Log in Appender specific way. Returns -1 on error, 0 otherwise. tiny numbers, huge consequences, iykyk. πŸ”₯

Parameters

  • event β€” The LoggingEvent to log.

virtual void log4tango::Appender::close (void) [pure virtual]

Release any resources allocated within the appender such as file handles, network connections, etc. aka: put your toys away when you're done. the way that this is mandatory because it's pure virtual… obsessed. ✨

Implemented in log4tango::OstreamAppender, and log4tango::FileAppender.


const std::string & log4tango::Appender::get_name (void) const [inline]

Returns this appender name. that's it, that's the function, she's simple and she knows it. πŸ’–


bool log4tango::Appender::is_valid (void) const [virtual]

Check if the appender is valid (for instance the underlying connection is ok) This default implementation always return true. Overload to define your own behaviour.

Returns

  • true if the appender is valid, false otherwise.

Reimplemented in log4tango::FileAppender.


void log4tango::Appender::level_changed (Level::Value new_level) [protected], [virtual]

Inform an appender that its Logger's logging level has changed. The default implementation does nothing. literally just vibing. πŸ§˜β™€οΈ

Parameters

  • new_level β€” The new Logger's level.

bool log4tango::Appender::reopen (void) [virtual]

Reopens the output destination of this Appender, e.g. the logfile or TCP socket. like a lil glow-up for your file handle. πŸ’…

Returns

  • false if an error occurred during reopening, true otherwise.

Reimplemented in log4tango::OstreamAppender, and log4tango::FileAppender.


virtual bool log4tango::Appender::requires_layout (void) const [pure virtual]

Check if the appender uses a layout. does she need the fit or not, that's the question. πŸŽ€

Returns

  • true if the appender implementation requires a layout.

Implemented in log4tango::LayoutAppender.


virtual void log4tango::Appender::set_layout (Layout * layout = 0) [pure virtual]

Change the layout. out with the old fit, in with the new. ✨

Implemented in log4tango::LayoutAppender.


friend class Logger [friend]

the one friend who gets to peek behind the curtain. privileged access, main character energy, no notes. πŸ‘‘


πŸ“ Author πŸ“

Generated automatically by Doxygen for log4tango from the source code. not a human author, just a robot doing its little robot thing, and honestly? she ate. πŸ€–βœ¨


heads up bestie: this was generated from the source code, so if something looks weird, blame the source, not the doc. πŸ™ˆ

and that's the whole page!! this is log4tango::Appender(3), Version 5.0.2, dated Thu Dec 5 2024 β€” so like, a lil vintage but still absolutely slaying. go forth and append responsibly. πŸ’–πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from