LOG4CPP::TIMESTAMPCOMPONENT(3)
π 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 astd::string timeFormatso 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 yourstd::ostringstream &outand aconst 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
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- opensuse-leap 16.0: log4cpp-devel 1.1.4-bp160.1.12 Β· LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms