Policy class

Policy determines if a given event qualifies for sending, based on:

  • severity threshold
  • environment gates
  • whether handled exceptions should be reported (vs only uncaught) Sampling, rate-limit, and dedupe are enforced at runtime (client) level.

Constructors

Policy({Severity minSeverity = Severity.error, bool reportHandled = true, Set<String> environments = const {}, double sampling = 1.0, RateLimit rateLimit = const RateLimit(10, Duration(minutes: 1)), DedupeStrategy dedupe = const DedupeStrategy.windowed()})
Creates a policy with optional overrides for gating behavior.
const

Properties

dedupe → DedupeStrategy
Dedupe strategy applied at runtime.
final
environments → Set<String>
Allowed environments; empty set means "any".
final
hashCode → int
The hash code for this object.
no setterinherited
minSeverity → Severity
Minimum severity that must be met for an event to qualify.
final
rateLimit → RateLimit
Rate-limiting configuration applied at runtime.
final
reportHandled → bool
Whether handled (caught) exceptions should be reported automatically.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sampling → double
Sampling probability (0..1) applied before runtime gating.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldSend(ReportEvent event, String currentEnvironment) → bool
Basic gating performed before runtime controls (sampling, rate-limit, dedupe).
toString() → String
A string representation of this object.
inherited

Operators

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