Skip to content

Phase 4.1-4.3: Structured logging & empty catch fixes#285

Merged
nbhansen merged 2 commits intoaau-giraf:dev-mainfrom
nbhansen:feature/phase4-logging
Feb 8, 2026
Merged

Phase 4.1-4.3: Structured logging & empty catch fixes#285
nbhansen merged 2 commits intoaau-giraf:dev-mainfrom
nbhansen:feature/phase4-logging

Conversation

@nbhansen
Copy link
Contributor

@nbhansen nbhansen commented Feb 8, 2026

Summary

Replace all ad-hoc Console.Write/print/debugPrint with structured logging frameworks, and fix all empty catch blocks.

Backend (4.1) — ILogger<T>

  • Replaced 80 Console.WriteLines with ILogger<T> across 8 source files
  • SyncController, MigrationService, BoardHub, ElevenLabsService, CategoriesController, WebApplicationExtensions use structured logging with {Placeholder} templates
  • DbContextExtensions and ImageUtilities use Console.Error.WriteLine (static contexts where DI is unavailable)
  • BoardHubTests updated with NullLogger<BoardHub>.Instance

Flutter (4.2) — package:logging

  • Added logging: ^1.3.0 dependency
  • Created AppLogger.init() utility (hierarchical logging, debug=ALL / release=WARNING, forwards to developer.log)
  • Replaced 509 print/debugPrint calls with Logger across 50 files
  • Removed 9 unused foundation.dart imports and 12 avoid_print ignore directives

Empty catches (4.3)

  • Added _log.fine/_log.warning to 23 empty catch blocks across 8 Flutter files
  • 0 empty_catches lint warnings remain

Verification

  • dotnet build: 0 errors, 0 warnings
  • ✅ VTA.Tests: 98/98 passed
  • ✅ SyncService.Tests: 25/25 passed
  • ✅ Flutter tests: 13/13 passed
  • flutter analyze: 0 errors (81 pre-existing warnings/infos only)

- sync.sh: one-command reset of dev-main to upstream after squash-merges
- .github/copilot-instructions.md: document git config, sync workflow, and
  standard PR merge procedure to prevent divergent branch issues
…ix empty catches

Backend (4.1):
- Replace 80 Console.WriteLines with ILogger<T> across 8 files
- SyncController, MigrationService, BoardHub, ElevenLabsService,
  CategoriesController, WebApplicationExtensions use structured logging
- DbContextExtensions, ImageUtilities use Console.Error (no DI available)
- BoardHubTests updated with NullLogger

Flutter (4.2):
- Add package:logging ^1.3.0 with AppLogger.init() utility
- Replace 509 print/debugPrint calls with Logger across 50 files
- Remove 9 unused foundation.dart imports
- Remove 12 avoid_print ignore directives

Empty catches (4.3):
- Add _log.fine/warning to 23 empty catch blocks across 8 Flutter files
- 0 empty_catches lint warnings remain
@nbhansen nbhansen merged commit 9b4103f into aau-giraf:dev-main Feb 8, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant