Capturing Logs
Capture Flutter app events, live-session log lines, SDK diagnostics, and grouped session properties.
Send an app event to the session timeline:
await Ansight.instance.event(
'Checkout completed',
type: AnsightEventType.info,
details: 'cart=primary',
);
Send a live log line:
await Ansight.instance.sendClientLog('Settings loaded');
Listen to native SDK diagnostics:
final subscription = Ansight.instance.logs.listen((entry) {
debugPrint('[Ansight ${entry.level}] ${entry.message}');
});
Update grouped properties with updateSessionProperties(...), registerCustomProperty(...), and removeCustomProperty(...).
Flutter Errors and Crash Candidates
AnsightFlutterInstrumentation.install(captureErrors: true) records Flutter framework and platform-dispatcher errors as exception events and adds non-fatal context to the native crash outbox. App-owned integrations can do the same explicitly:
await Ansight.instance.recordCrashCandidate(
runtime: 'flutter-dart',
kind: 'caught_zone_error',
message: error.toString(),
stack: stackTrace.toString(),
fatal: false,
metadata: const <String, String>{'component': 'checkout'},
);
Non-fatal Dart candidates are context for an independently confirmed native exit; they are not crash reports by themselves. Crash capture is enabled by default and recovered after the next launch. See Crash Capture, and do not include secrets or personal data in error messages, stacks, or metadata.
On a paired physical iPhone or iPad, these app-provided lines and Ansight SDK diagnostics stream to Studio with the session. General OS, device, and unrelated process logs remain in Xcode or the Apple device log tooling.