EasyException
ee::LogRetentionOlderThan Class Reference

This class will release all logs older than the given datetime. More...

#include <ee/LogRetentionPolicy.hpp>

Inheritance diagram for ee::LogRetentionOlderThan:
ee::LogRetentionPolicy

Public Member Functions

 LogRetentionOlderThan (const std::chrono::milliseconds &lifetime) noexcept
 Constructor. More...
 
void init () noexceptoverride
 Initializes this class before execution of a cycle.
 
bool retain (const LogEntry &logEntry) noexceptoverride
 Decides whether to retain or release the given log entry. More...
 

Private Attributes

const std::chrono::milliseconds mLifetime
 Specifies the time between the start of the cycle and the oldest log entry.
 
std::chrono::system_clock::time_point mDatetime
 This stores the line where older log entries should be released.
 

Additional Inherited Members

- Protected Member Functions inherited from ee::LogRetentionPolicy
 LogRetentionPolicy (uint8_t priority) noexcept
 Constructor. More...
 

Detailed Description

This class will release all logs older than the given datetime.

Constructor & Destructor Documentation

ee::LogRetentionOlderThan::LogRetentionOlderThan ( const std::chrono::milliseconds &  lifetime)
explicitnoexcept

Constructor.

Parameters
dateLimitThis date limit will mark the line where older logs are released.

Member Function Documentation

bool ee::LogRetentionOlderThan::retain ( const LogEntry logEntry)
overridevirtualnoexcept

Decides whether to retain or release the given log entry.

Parameters
logEntryThe log entry to retain or release.
Returns
True if the given log entry should be retained.

Implements ee::LogRetentionPolicy.


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