Skip to main content
The Flutter device app (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

SurfaceBehaviour
ConsoleFormatted lines (web: browser console; iOS/macOS: dart:developer log; other targets: debugPrint).
In-appSettings → 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 errorsFlutterError.onError, PlatformDispatcher.instance.onError, and runZonedGuarded forward into Talker (debug builds still call FlutterError.presentError for the red screen).
Application code should keep using the existing 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

PathRole
lib/main.dartWidgetsFlutterBinding.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.dartBuilds the global Talker with a combined console + file output.
lib/core/logging/log_file_sink.dartConditional export: real dart:io sink vs web stub.
lib/core/logging/log_file_sink_io.dartOpens/rotates hiro_app.log, appends lines.
lib/features/debug/app_logs_screen.dartWraps 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):
  1. Buffer log lines (or batches) on the device so the gateway is not spammed per line.
  2. 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.
  3. Append on the server into the workspace log directory, for example device-<deviceId>.log (plain text or a CSV shape aligned with hiro_commons if you want one parser).
  4. 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.
Until that ships, operators rely on device-local logs: in-app App logs, exported Talker history, terminal output when running flutter run, and on mobile/desktop the hiro_app.log file path from app support storage.
  • Flutter app — overall app architecture and folder layout.
  • Server logging — workspace CSV logs and Admin tail/search.
  • Admin UI — dashboard scope and Logs section.