emitLog method

  1. @override
Future<void> emitLog(
  1. LogEvent event
)
override

Performs the actual delivery of event to the transport's destination.

Called only when event.level >= this.level. Implementations must not throw; swallow or handle errors internally.

Implementation

@override
Future<void> emitLog(LogEvent event) async {
  final shouldSample = levels.isEmpty || levels.contains(event.level);
  if (shouldSample && _random.nextDouble() >= sampleRate) {
    return; // dropped
  }
  await inner.log(event);
}