Understand app behavior with logs
Add Flutter app events and diagnostic context to a session so you can investigate what happened behind a visible result.
App events give session review a record of the decisions, milestones, and errors your app reports. Use them to connect visible behavior with context such as a completed checkout or failed sync.
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 the local host with the session. General OS, device, and unrelated process logs remain in Xcode or the Apple device log tooling.