Skip to content

Feat/structured logging - #5

Open
BrawlerXull wants to merge 3 commits into
mainfrom
feat/structured-logging
Open

BrawlerXull wants to merge 3 commits into
mainfrom
feat/structured-logging

Conversation

@BrawlerXull

Copy link
Copy Markdown
Owner

Description

Please include a summary of the change and which issue is fixed. List any dependencies that are required for this change.

Fixes #(issue_no)

Replace issue_no with the issue number which is fixed in this PR

Screenshots

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

BrawlerXull and others added 3 commits October 4, 2026 17:55
- AppLogger now builds LogRecords (time, level, tag, message, error,
  stack trace) and hands info-and-above to an attached LogSink; debug
  records stay console-only.
- main() no longer overrides debugPrint, so raw prints and framework
  output are no longer persisted. FlutterError.onError and
  PlatformDispatcher.onError now log uncaught errors.
- LogDatabaseHelper (renamed from log_databse_helper.dart) is a
  singleton sink: schema v2 with level/tag/error/stack columns, batched
  writes (errors flushed immediately), and pruning to 7 days / 5000
  entries on open. The v1 table is dropped on upgrade: it held untyped
  debugPrint lines that could include task contents.
- Logs page: level filter chips, tag filter, level colours, expandable
  stack traces and a Copy button for bug reports. LogsController takes
  its store via the constructor.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Replaces ~125 raw debugPrint/print calls and the three loggy calls with
tagged AppLogger calls, and drops the loggy dependency.

- Privacy: stop logging task contents (descriptions, tags, annotations,
  whole task maps/JSON), profile names, full deep-link URIs (query
  strings can carry task text) and push-notification response bodies.
  Log UUIDs and counts instead.
- Errors now carry their stack traces as arguments instead of being
  interpolated into the message or printed as a separate line.
- Previously silent catches now log a warning where the failure is
  unexpected (report loading, .taskrc parsing, directory moves, tour
  display); expected ones stay silent with a comment saying why.
- Routine flow traces are debug-level (console only); emoji and
  fragment messages are rewritten as sentences.
- Cleanup: remove commented-out print code and the dead commented-out
  home-widget click handlers (plus the two fields only they used),
  the unused printDatabaseContents(), unused imports, and rename
  utilites.dart -> utilities.dart.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
- Logs page: Copy now replaces the current snackbar, so its result is
  not queued behind a sticky one (e.g. "TaskServer is not configured").
- Home widget: the "project filter" debug flag used the wrong sentinel
  and always reported true; it now mirrors the filter's own check.
- Home app bar: the Taskserver sync failure catch now logs a warning
  instead of discarding the error.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant