Serenity Logger
A very fast and effiecient logging library. This library currently can log to files, rotate files when logging, log to the terminal, and is aware if the terminal is being piped during logging.
serenity::msg_details::Message_Time Class Reference

This class is in charge of caching the time-related values used in formatting the prepended text for a log message.

Public Member Functions

 Message_Time (message_time_mode mode)
 Sets the time mode used in caching and other time-related functions from the mode variable and initializes the cache.
 
 Message_Time (const Message_Time &)=delete
 
Message_Timeoperator= (const Message_Time &)=delete
 
std::string_view GetCurrentYearSV (int yearOffset, bool shortened=false)
 Takes the year offset value and returns either the year in YYYY format if shortened is set to false or in YY format if shortened is set to true.
 
void UpdateTimeDate (std::chrono::system_clock::time_point timePoint)
 Takes the current time point and returns the time-related values for that time point.
 
void UpdateCache (std::chrono::system_clock::time_point timePoint)
 Calls UpdateTimeDate() internally and uses the values returned to update the cache values.
 
std::tm & Cache ()
 Returns the cache holding the time-related values.
 
message_time_modeMode ()
 Returns the time mode currently being used to populate and update the cache and other time-related functions.
 
void SetTimeMode (message_time_mode mode)
 Sets the time mode to use in intializing/updating the cache and for other time-related functions (local time or utc time).
 
std::chrono::seconds & LastLogPoint ()
 Returns the cached time point in terms of seconds for when the last log message was made. More...
 

Member Function Documentation

◆ LastLogPoint()

std::chrono::seconds & serenity::msg_details::Message_Time::LastLogPoint ( )

This function is used to determine if the cache should be updated based on a second time lapse


The documentation for this class was generated from the following files: