logs property

Stream<TrustPinLogEvent> get logs

A broadcast stream of the native SDK's log output, for routing SDK logs into the host app's logging pipeline (an in-app console, a file logger, a crash reporter's breadcrumbs, …).

The underlying native log sink is global: this one stream carries the output of every TrustPin instance, each message tagged with the TrustPinLogEvent.instanceId that produced it ('default' for shared). What is logged — and at which verbosity — is still controlled per instance via setLogLevel; the stream only chooses where already-filtered messages go. While no one listens, the native SDK logs to its platform default (logcat on Android, stdout/os_log on iOS/macOS).

final subscription = TrustPin.logs.listen((event) {
  debugPrint('[TrustPin/${event.level.value}] ${event.message}');
});

The native sink is installed when the first subscription starts and removed when the last one cancels.

Implementation

static Stream<TrustPinLogEvent> get logs =>
    TrustPinSDKPlatform.instance.logEvents.map(TrustPinLogEvent.fromMap);