upkie  11.0.0
Open-source wheeled biped robots
RateLimitFilter Class Reference

Logging filter that rate-limits repeated warnings from the same source. More...

Public Member Functions

def __init__ (self, float min_interval=1.0)
 Initialize the filter. More...
 
bool filter (self, logging.LogRecord record)
 Allow a record through only if enough time has passed since the last emission from the same source line. More...
 

Detailed Description

Logging filter that rate-limits repeated warnings from the same source.

Useful for high-frequency loops where the same warning would otherwise spam the terminal on every cycle.


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