EasyException
ee::LogRetentionMaxNumber Class Reference

This class decides how much logs should be retained, the oldest ones will be released. More...

#include <ee/LogRetentionPolicy.hpp>

Inheritance diagram for ee::LogRetentionMaxNumber:
ee::LogRetentionPolicy

Public Member Functions

 LogRetentionMaxNumber (size_t maxNumber) noexcept
 Constructor. More...
 
void init () noexceptoverride
 Initializes this class before every cycle.
 
bool retain (const LogEntry &logEntry) noexceptoverride
 Decides whether to retain or relase the given log entry. More...
 

Private Attributes

const size_t mMaxNumberOfLogs
 The maximum number of logs we want to retain.
 
size_t mCounter = 0
 The counter that remembers the number of logs already retained.
 

Additional Inherited Members

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

Detailed Description

This class decides how much logs should be retained, the oldest ones will be released.

Constructor & Destructor Documentation

ee::LogRetentionMaxNumber::LogRetentionMaxNumber ( size_t  maxNumber)
explicitnoexcept

Constructor.

Parameters
maxNumberThe maximum number of logs that should be retained.

Member Function Documentation

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

Decides whether to retain or relase the given log entry.

Parameters
logEntryThe log entry to decide for.
Returns
True if the given log entry should be retained.

Implements ee::LogRetentionPolicy.


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