log4tango::PatternLayout(3)
β¨ log4tango::PatternLayout β¨
okay bestie, say hi to log4tango::PatternLayout π β this is the layout in the log4tango manual (section 3, library calls, iykyk) that lets you boss your log lines around and tell them exactly how to look. she's giving main character energy and she's fr fr about formatting. π
πΈ SYNOPSIS πΈ
#include <PatternLayout.hh>
She inherits log4tango::Layout, so all that Layout goodness is hers by right. π
π¦ Classes
class PatternComponentβ her lil inner class, living her best life.
π«Ά Public Member Functions
PatternLayout ()β the constructor, hi babes πvirtual ~PatternLayout ()β the destructor, bye babes πvirtual std::string format (const LoggingEvent &event)β Formats theLoggingEventin the style set by theset_conversion_patterncall. she literally takes your event and dresses it up. β¨virtual int set_conversion_pattern (const std::string &conversionPattern)β Sets the format of log lines handled by thisPatternLayout. this is the glow-up button. π₯virtual std::string get_conversion_pattern () constβ hands you back the pattern, no questions asked.virtual void clear_conversion_pattern ()β yeets the pattern into the void. π
π Static Public Attributes
static const char * BASIC_CONVERSION_PATTERN = '%R %p %c %m%n'β a conversion pattern equivalent to theBasicLayout. the vanilla-but-make-it-cute starter pack. π
π§ Constructor & Destructor Documentation π§
log4tango::PatternLayout::PatternLayout ()
the birth of an icon. no notes. π
log4tango::PatternLayout::~PatternLayout () [virtual]
and that's a wrap, she's virtual about her exit. π
π Member Function Documentation π
void log4tango::PatternLayout::clear_conversion_pattern () [virtual]
clears the conversion pattern. gone, reduced to atoms, periodt. π
std::string log4tango::PatternLayout::format (const LoggingEvent & event) [virtual]
Formats the LoggingEvent in the style set by the set_conversion_pattern call. By default, set to '%%m%%n'
Reimplemented from log4tango::Layout.
she said "I'm not like other layouts" and she meant it. π
std::string log4tango::PatternLayout::get_conversion_pattern () const [virtual]
gives you the current conversion pattern. that's it, that's the function, no cap. π«Ά
int log4tango::PatternLayout::set_conversion_pattern (const std::string & conversionPattern) [virtual]
Sets the format of log lines handled by this PatternLayout. By default, set to '%%m%%n'.
format characters are as follows, bestie, memorize them, they're the whole vibe check:
%%%%β a single percent sign%cβ the logger%dβ the date- Date format: the date format character may be followed by a date format specifier enclosed between braces. For example,
%d{%H:%M:%S,%l}or%d{%d %m %Y %H:%M:%S,%l}. If no date format specifier is given then the following format is used:'Wed Jan 02 02:03:55 1980'. The date format specifier admits the same syntax as the ANSI C functionstrftime, with 1 addition. The addition is the specifier%lfor milliseconds, padded with zeros to make 3 digits.
- Date format: the date format character may be followed by a date format specifier enclosed between braces. For example,
%mβ the message%nβ the platform specific line separator%pβ the level%rβ milliseconds since this layout was created.%Rβ seconds since Jan 1, 1970%uβ clock ticks since process start%xβ the NDC
Parameters
- conversionPattern β the conversion pattern
Exceptions
ConfigureFailureβ if the pattern is invalid. > girl if you typo the pattern she WILL throw hands. π keep it valid or keep it quiet.
π Member Data Documentation π
const char * log4tango::PatternLayout::BASIC_CONVERSION_PATTERN = '%R %p %c %m%n' [static]
A conversion pattern equivalent to the BasicLayout. the blueprint, the origin story, the moment before the fame. β
π Author π
Generated automatically by Doxygen for log4tango from the source code. so yes, a robot wrote this, and she ate. π€π
and that's the whole page bestie!! π«Ά version 5.0.2, dated Thu Dec 5 2024 β mwah, kiss the manual, she's done. ππβ¨
π¦ 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