SamplingFilter<T> class

Logs only every sampleRate-th event (1-based counting).

This is the only intentionally stateful built-in filter — it maintains an internal counter. All other filters are stateless.

Inheritance

Constructors

SamplingFilter({required int sampleRate})

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampleRate int
Log every N-th call (e.g. sampleRate: 10 logs 10th, 20th, …).
final

Methods

apply(T value) bool
Returns true if value should be logged.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited