feat(firmware): make FirmwareUpdateService logger optional (NullLogger default) (part of #340) - #361
Conversation
…r default) (part of #340) FirmwareUpdateService required a non-nullable ILogger, so DI-less consumers had to construct and pass one just to use it. The logger parameter is now optional and defaults to NullLogger<FirmwareUpdateService>.Instance, matching the optional-logger convention the rest of the library uses. Non-breaking (callers passing a logger are unaffected; the parameter sits before the existing optional parameters). No flash-path logic changed. Addresses acceptance-criterion 4 of #340. - New test: construction without a logger does not throw. Full suite 1636 pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoMake FirmwareUpdateService logger optional (NullLogger default)
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
|
Qodo review complete (0 unresolved), CI green, full suite 1636 pass. Ready for review. |
The change is narrowly scoped: |
Summary
FirmwareUpdateServicerequired a non-nullableILogger<FirmwareUpdateService>, so a DI-less consumer had to construct and pass one just to use the service. Theloggerparameter is now optional, defaulting toNullLogger<FirmwareUpdateService>.Instance— matching the optional-logger conventionMessageProducer(and #360'sDaqifiDevice) already use. Addresses acceptance-criterion 4 of #340.Changes
loggerparameter:ILogger<FirmwareUpdateService> logger→ILogger<FirmwareUpdateService>? logger = null; the?? throw ArgumentNullExceptionfallback becomes?? NullLogger<FirmwareUpdateService>.Instance. Non-breaking — the parameter already sits before the existing optional parameters, and callers passing a logger are unaffected. No flash-path logic changed.Testing
dotnet test— 1636 pass / 0 fail / 2 skipped (net9.0 + net10.0); FirmwareUpdateService suite 64/64.Scope note
Closes acceptance-criterion 4 of #340. The remaining item — optional loggers on the device finders and transports — is a separate follow-up. Does not close #340 (criteria 1–2 are #360, this is criterion 4).
Not merging — for review.
🤖 Generated with Claude Code