ailog_flutter 0.3.0
ailog_flutter: ^0.3.0 copied to clipboard
Flutter add-on for ailog: automatic error hooks, navigation breadcrumbs, and a bridge so native Kotlin/Swift code logs into the same JSONL file.
Changelog #
This package is pre-1.0 and under active development, and tracks
ailog's version closely — a minor bump in either may break you. Pin exact
versions and read both changelogs before upgrading.
0.3.0 #
- A
flutter buildrelease now ships with logging off. This followsailog0.4.0, whereLogger.create'senableddefaults to!isReleaseBuild: debug and profile are unaffected, and a release build writes nothing to a user's device unless you passenabled: true(or a runtime flag, for a diagnostics toggle in settings).AilogFlutter.installandrunAppGuardedare unchanged — they route errors into whatever logger you hand them, and a disabled one accepts every call and produces nothing. If you ship a way to retrieve the file, opt back in; the README's "Debug / profile / release" section covers both directions. - Automatic debug-session sync documented, built on
ailog's newinstallDebugSync+ailog_sync. It is now the first option under "Getting the log off a real device", because it is the only one with no manual step:flutter runalready opens the VM Service, so a command on your machine can pull the log continuously while you use the app. Release builds are unaffected — they serve no VM Service at all. AilogLifecycleObserver— foreground/background/termination, with both ends of each transition (paused → resumed). A handful of events over a session, and repeatedly decisive: "crashes when you come back to the app" is invisible in a log that only records what the code did. Defaults totrace, so it stays out of a production file while remaining available as a breadcrumb.- User interaction logging documented, built on
ailog's newlogger.interaction(). Deliberately no automatic "log every tap": measured against a real widget tree, a rootListenerplus a hit test recovers a useful label only for text-labelled buttons — anIconButtonyields "a button", aTextFieldnothing — while costing a hit test per pointer-down and carrying a privacy problem regex redaction cannot solve (semantic labels contain user data: a contacts row is labelled with a person's name). The README states this, with the numbers and a recipe for anyone who wants it anyway. runAppGuardedgainscapturePrint/forwardPrintsToConsole: plainprint()calls (yours or a dependency's) are routed into the structured log viaailog'scapturePrints.- Depends on
ailog ^0.4.0as a hosted dependency, making the package publishable; local development usespubspec_overrides.yaml.
0.2.0 #
ailog_flutteris now a Flutter plugin (addsandroid/andios/).AilogNativeBridge: forwards native (KotlinAilog, SwiftAilog) log calls into the DartLoggerover aMethodChannel, so native and Dart events share one JSONL file with the same redaction/sanitization.- Android:
AilogKotlin API plus a chainedThread.setDefaultUncaughtExceptionHandlerthat writes crash events directly to the configured JSONL path when the Flutter engine may already be gone. - iOS:
AilogSwift API plus a chainedNSSetUncaughtExceptionHandlerwith the same direct-write fallback (Objective-CNSExceptiononly — see the README for coverage limitations). ailog: addedLogger.logError(log a pre-builtErrorInfo, e.g. from a non-Dart error) anderrorFingerprintFromFrames(fingerprint an error from plain frame strings rather than a DartStackTrace) to support the above.- Example app: full
android/iosplatform scaffolding, plus a button demonstrating the native→Dart round trip.
0.1.0 #
- Initial release:
AilogFlutter.installhooks forFlutterError.onError,PlatformDispatcher.onErrorandErrorWidget.builder(all chaining any previously installed handler),AilogNavigatorObserverfor route breadcrumbs, andrunAppGuardedfor zone-scopedmain()wiring.