log4tango::Appender(3)
π 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 forAppender. she cleans up. iconic behaviour. β¨int append(const LoggingEvent &event)β Log inAppenderspecific way.virtual bool reopen(void)β Reopens the output destination of thisAppender, 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 forAppender.virtual void level_changed(Level::Value new_level)β Inform an appender that itsLogger's logging level has changed.virtual int _append(const LoggingEvent &event)=0β Log inAppenderspecific 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β TheLoggingEventto 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β TheLoggingEventto 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
trueif the appender is valid,falseotherwise.
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 newLogger'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
falseif an error occurred during reopening,trueotherwise.
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
trueif 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.
π Friends And Related Function Documentation π
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
- debian bookworm: liblog4tango-doc 9.3.4+dfsg1-2+deb12u1 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms