LoggerFileRotating will write log messages to a file that is rotated at midnight.
LoggerFileRotating( const fs::path &folder, const std::string &formatStr, bool appendToExisting = true );
folderdefines the root folder that will contain the logfile. If a blank string is provided, the folder will default to the folder that contains the application binary.
formatStris the string that will be evaluated by strftime and turned into the logfile name. For example, the string
cinder.%Y.%m.%d.logcould evaluate to
cinder.2015.08.28.log. Note that, since the log name is only re-evaluated once daily, using a format that includes minutes or seconds may not produce the results you're expecting. If a blank format string is provided, an assertion will be thrown.
appendToExistingconfigures file appending. This parameter defaults to
Public Member Functions
LoggerFileRotating (const fs::path &folder, const std::string &formatStr, bool appendToExisting=true)
Creates a rotating log file that will rotate when the first logging event occurs after midnight.
formatStrwill be passed to strftime to determine the file name.
write (const Metadata &meta, const std::string &text) override
const fs::path &getFilePath () const
Returns the file path targeted by this logger.
setTimestampEnabled (bool enable=true)
boolisTimestampEnabled () const