device_apps) uses Talker and talker_flutter for structured logs, global error capture, and an in-app log screen. Server-side CSV logging and the Admin UI log viewer are documented on Server logging and Admin UI; this page covers the device side only.
What you get today
| Surface | Behaviour |
|---|---|
| Console | Formatted lines (web: browser console; iOS/macOS: dart:developer log; other targets: debugPrint). |
| In-app | Settings → App logs opens TalkerScreen (history, filters, export). Route: /app/logs. |
| On-disk (IO only) | Plain-text append to hiro_app.log under the app support directory; rotates to hiro_app.log.1 when the active file exceeds ~8 MiB. Web has no file sink (stub implementation). |
| Unhandled errors | FlutterError.onError, PlatformDispatcher.instance.onError, and runZonedGuarded forward into Talker (debug builds still call FlutterError.presentError for the red screen). |
Logger facade in lib/core/utils/logger.dart (Logger.get('Tag'), info / warning / error / debug with optional fields). That type forwards to a single global Talker instance from lib/core/logging/app_talker.dart (ensureAppTalkerInitialized, appTalker).
Key source files
| Path | Role |
|---|---|
lib/main.dart | WidgetsFlutterBinding.ensureInitialized, Talker init, error hooks, and runApp run in the same zone (inside runZonedGuarded) to avoid Flutter’s zone mismatch warning. |
lib/core/logging/app_talker.dart | Builds the global Talker with a combined console + file output. |
lib/core/logging/log_file_sink.dart | Conditional export: real dart:io sink vs web stub. |
lib/core/logging/log_file_sink_io.dart | Opens/rotates hiro_app.log, appends lines. |
lib/features/debug/app_logs_screen.dart | Wraps TalkerScreen with theme and back navigation. |
Anticipated: device logs in the Admin UI
Today the Admin Logs experience is built around files on the Root Node (server.log, channel logs, gateway log, etc.) merged in the log viewer (see Server logging). The Flutter app does not yet stream logs to the server.
Planned direction (not implemented):
- Buffer log lines (or batches) on the device so the gateway is not spammed per line.
- Send over the existing device ↔ gateway connection (for example a small request method or tool invoked like other gateway RPC), or a dedicated HTTP endpoint if that fits security and deployment better.
- Append on the server into the workspace log directory, for example
device-<deviceId>.log(plain text or a CSV shape aligned withhiro_commonsif you want one parser). - Extend the Admin log viewer’s file glob / source list so device files appear next to server and plugin logs, reusing the same tail/search tools where possible.
flutter run, and on mobile/desktop the hiro_app.log file path from app support storage.
Related pages
- Flutter app — overall app architecture and folder layout.
- Server logging — workspace CSV logs and Admin tail/search.
- Admin UI — dashboard scope and Logs section.
