dev_log_client 0.2.2 copy "dev_log_client: ^0.2.2" to clipboard
dev_log_client: ^0.2.2 copied to clipboard

Flutter/Dart client for dev_log_viewer. Forwards logs to the local viewer with a Dio interceptor, AppLog shortcuts, and raw log sender.

Changelog #

0.2.2 #

  • Discovery no longer gives up permanently when no server is found. Previously, if the app started before dev_log_viewer was running, discovery failed once and all subsequent LogForwarder.send() calls were silently dropped for the lifetime of the session. Now discovery retries every 5 seconds so logs start flowing as soon as the server comes up, without restarting the app. Buffered startup entries are preserved across retries and delivered on the first successful connection.
  • LogForwarder.send() is now a no-op in release builds. The _kDebugMode guard was missing from send(), so in release builds entries accumulated in the pending buffer indefinitely (up to 200, then oldest were dropped). init() was already guarded; send() now matches.
  • Discovery now prefers the most recently started server when no project name matches, instead of always picking the lowest port. This fixes the common case where port 8181 is occupied by a stale viewer from a previous session and the new server starts on 8182 — the right server now wins.
  • Discovery ignores ports that don't look like a dev_log_viewer. Ports are now fingerprinted by checking that the ping response includes status: 'ok' and echoes back the correct port number, so unrelated services that happen to return JSON from /ping are no longer mistaken for a viewer.
  • Copy button now includes body and error for API error entries. The error message format sent by DevLogInterceptor.onError changed from GET url → 404 · ms to <-- 404 url · ms (consistent with success responses) so the viewer's copy function can parse it correctly.
  • iOS example: added NSAllowsLocalNetworking ATS exception so HTTP connections to localhost are not blocked on iOS 26+.

0.2.1 #

  • Startup logs are no longer silently dropped. Entries sent via LogForwarder.send() before port discovery completes are now buffered (up to 200) and flushed to the server once discovery succeeds. Discovery can take a few hundred milliseconds (ping timeouts), so anything logged during main() startup would previously vanish with no error or trace.
  • LogForwarder.send() now captures the timestamp at call time rather than at HTTP post time — buffered entries show the correct event time, not the time they were flushed.

0.2.0 #

  • LogForwarder.init() now accepts an optional project parameter. Auto-detecting the project name by reading pubspec.yaml only ever worked on desktop/CLI targets — on iOS/Android the app runs sandboxed with no such file on disk, so discovery silently fell back to "lowest port wins." Pass project explicitly on mobile:
    LogForwarder.init(project: 'my_app');
    
  • Discovery no longer connects to whichever server answers first. It pings every candidate port (8181–8185) concurrently via the side-effect-free /ping endpoint, then prefers a server reporting the same project, picking the most recently started one among those. Previously a stale server from a previous run (or a different project) on a lower port would win the race every time.
  • DevLogInterceptor request/response/error bodies are sent unredacted — this is a localhost-only, debug-only tool, and the point is being able to inspect (and copy) real request/response data while debugging. The viewer UI masks sensitive fields by default and reveals them on click instead.

0.1.1 #

  • Documentation only — dartdoc comments added across the public API, no behavioural changes.

0.1.0 #

  • Initial release.
  • LogForwarder — raw log sender with auto-discovery across ports 8181–8185.
  • DevLogInterceptor — zero-config Dio interceptor for automatic API traffic logging.
  • AppLog — named tag shortcuts (auth, nav, store, api, error, log).
  • All output suppressed automatically in release builds via dart.vm.product.
0
likes
140
points
49
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter/Dart client for dev_log_viewer. Forwards logs to the local viewer with a Dio interceptor, AppLog shortcuts, and raw log sender.

Repository (GitHub)
View/report issues

Topics

#logging #debug #developer-tools #dio #flutter

License

MIT (license)

Dependencies

dio

More

Packages that depend on dev_log_client