MCU
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
RateLimitedLogger Class Reference

#include <PrintLogger.h>

Collaboration diagram for RateLimitedLogger:
Collaboration graph

Public Member Functions

 RateLimitedLogger ()
 
template<typename T >
void log_out (T out, unsigned long current_millis, unsigned long period=100)
 

Private Attributes

unsigned long last_out_time_
 

Detailed Description

Definition at line 25 of file PrintLogger.h.

Constructor & Destructor Documentation

◆ RateLimitedLogger()

RateLimitedLogger::RateLimitedLogger ( )
inline

Definition at line 30 of file PrintLogger.h.

31 {
33 }
unsigned long last_out_time_
Definition: PrintLogger.h:28

Member Function Documentation

◆ log_out()

template<typename T >
void RateLimitedLogger::log_out ( out,
unsigned long  current_millis,
unsigned long  period = 100 
)
inline

Definition at line 36 of file PrintLogger.h.

36 {
37 if((current_millis - last_out_time_) > period)
38 {
39 logger_println<T>(out);
40 last_out_time_ = current_millis;
41 }
42 }

Member Data Documentation

◆ last_out_time_

unsigned long RateLimitedLogger::last_out_time_
private

Definition at line 28 of file PrintLogger.h.


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