Skip to content

fix: Replace Console.WriteLine with ILogger in SyncService BoardHub#280

Closed
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/syncservice-logging
Closed

fix: Replace Console.WriteLine with ILogger in SyncService BoardHub#280
nbhansen wants to merge 1 commit intoaau-giraf:dev-mainfrom
nbhansen:fix/syncservice-logging

Conversation

@nbhansen
Copy link
Contributor

@nbhansen nbhansen commented Feb 4, 2026

Summary

  • Replaces 58 Console.WriteLine calls in BoardHub.cs with proper ILogger calls
  • Enables structured logging for better observability in production
  • Uses appropriate log levels:
    • LogInformation: State transitions (register, connect, disconnect)
    • LogWarning: Missing data, not found conditions
    • LogError: Exceptions
    • LogDebug: Verbose checks (already connected, etc.)

Test plan

  • Build passes
  • All 25 SyncService tests pass
  • Verified structured log output in Docker environment

- Add ILogger<BoardHub> dependency injection
- Convert 58 Console.WriteLine calls to structured logging:
  - State transitions → LogInformation
  - Missing data/not found → LogWarning
  - Exceptions → LogError
- Update BoardHubTests to provide mock logger

This improves production observability and enables proper
log aggregation and filtering.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@nbhansen nbhansen force-pushed the fix/syncservice-logging branch from b600cc8 to b1a3ef0 Compare February 4, 2026 14:06
@nbhansen nbhansen closed this Feb 5, 2026
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