check_trace_log::_MessageCollector class

Defined in module check_trace_log (check_trace_log.py).

Count messages while retaining only a bounded leading sample.

Public functions

auto __init__(self, int limit) -> None
Initialize an empty collector with a retained-message limit.
auto append(self, str message) -> None
Count one message and retain it while the sample has capacity.

Public attributes

limit
total
messages

Function documentation

None check_trace_log::_MessageCollector::__init__(self, int limit)

Initialize an empty collector with a retained-message limit.

Parameters
limit Maximum number of leading messages to retain. All appended messages still contribute to total.

None check_trace_log::_MessageCollector::append(self, str message)

Count one message and retain it while the sample has capacity.

Parameters
message Message text to count and potentially retain.