LOG4CPP::TIMESTAMPCOMPONENT(3)

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

πŸ’… log4cpp::TimeStampComponent πŸ’…

okay bestie, so this page lives in the Library Functions Manual for log4cpp and it's literally all about log4cpp::TimeStampComponent β€” a little pattern component that stamps the time into your log output πŸ•βœ¨ no cap, that's the whole vibe.


🌸 NAME 🌸

log4cpp::TimeStampComponent β€” the timestamp-y component, and yes that's the entire name section, she's brief and she's iconic πŸ’β€β™€οΈ


✨ SYNOPSIS ✨

ok so first thing: she inherits from log4cpp::PatternLayout::PatternComponent 🧬 like that's her whole lineage, that's her main character origin story.

🫢 Public Member Functions

  • TimeStampComponent (std::string timeFormat) β€” the constructor, and it takes a std::string timeFormat so you can tell her how you want your timestamps to look πŸ’–
  • virtual void append (std::ostringstream &out, const LoggingEvent &event) β€” the virtual function that does the appending thing: takes your std::ostringstream &out and a const LoggingEvent &event πŸ¦‹

🌈 Public Member Functions inherited from log4cpp::PatternLayout::PatternComponent

  • virtual ~PatternComponent () β€” the destructor she gets from her parent, inherited and living her life, we love a hand-me-down 😌

⭐ Static Public Attributes

These are the preset format strings, all static const char *const, and honestly? gifts 🎁

  • FORMAT_ISO8601 = '%Y-%m-%d %H:%M:%S,%l'
  • FORMAT_ABSOLUTE = '%H:%M:%S,%l'
  • FORMAT_DATE = '%d %b %Y %H:%M:%S,%l'

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

log4cpp::TimeStampComponent::TimeStampComponent (std::string timeFormat)

marked [inline] 🧚 so she's inline, she's cozy, she's right there in the header. pass her your std::string timeFormat and she's good to go πŸ’œ


πŸ”₯ Member Function Documentation πŸ”₯

virtual void log4cpp::TimeStampComponent::append (std::ostringstream & out, const LoggingEvent & event)

[inline], [virtual] β€” both tags, she's that girl πŸ’…

and listen: Implements log4cpp::PatternLayout::PatternComponent β€” that's her job, that's what she's here for, she implements the thing πŸ‘‘


πŸ“ Member Data Documentation πŸ“

all three are [static], all three are const char *const, and here they are in all their glory:

  • const char *const log4cpp::TimeStampComponent::FORMAT_ABSOLUTE = '%H:%M:%S,%l'  [static]
  • const char *const log4cpp::TimeStampComponent::FORMAT_DATE = '%d %b %Y %H:%M:%S,%l'  [static]
  • const char *const log4cpp::TimeStampComponent::FORMAT_ISO8601 = '%Y-%m-%d %H:%M:%S,%l'  [static]
fr fr just copy these into your timeFormat and you're slaying, don't overthink it 🫢

🌟 Author 🌟

Generated automatically by Doxygen for log4cpp from the source code. β€” so nobody hand-wrote this, Doxygen did, and honestly? she ate πŸ€–βœ¨


and that's the whole page bestie, mwah πŸ’‹ this lil doc came to you courtesy of log4cpp, Version 1.1 β€” the manpage footer didn't hand me a date so I'm not gonna make one up, iykyk πŸ™ˆ see you in the next one! πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from