log4tango::PatternLayout(3)

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

✨ 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 the LoggingEvent in the style set by the set_conversion_pattern call. 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 this PatternLayout. 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 the BasicLayout. 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 function strftime, with 1 addition. The addition is the specifier %l for milliseconds, padded with zeros to make 3 digits.
  • %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