feat: switch ASB transport to compile-time logging source generation#4017
Merged
DevJonny merged 2 commits intoFeb 18, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR completes the Azure Service Bus transport’s migration from runtime Logger.Log*() calls to source-generated logging via [LoggerMessage], aligning these remaining components with the pattern already used elsewhere in the transport.
Changes:
- Converted logging calls in
AzureServiceBusConsumer,AzureServiceBusMessageProducer, andAzureServiceBusMesssageCreatorto[LoggerMessage]-based source-generated methods. - Marked the affected types as
partialand introduced nestedprivate static partial class Logcontainers for generated log methods.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| src/Paramore.Brighter.MessagingGateway.AzureServiceBus/AzureServiceBusMesssageCreator.cs | Replaces runtime logging in message mapping with source-generated logging methods. |
| src/Paramore.Brighter.MessagingGateway.AzureServiceBus/AzureServiceBusMessageProducer.cs | Replaces runtime logging in producer/bulk send paths with source-generated logging methods. |
| src/Paramore.Brighter.MessagingGateway.AzureServiceBus/AzureServiceBusConsumer.cs | Replaces runtime logging in consumer receive/ack/dead-letter paths with source-generated logging methods. |
lillo42
approved these changes
Feb 17, 2026
iancooper
approved these changes
Feb 17, 2026
preardon
approved these changes
Feb 17, 2026
…righterCommand#3965) Convert the remaining 3 files in the Azure Service Bus transport from runtime Logger.Log*() calls to [LoggerMessage] source-generated methods, matching the pattern already used in the rest of the ASB project. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Fix "peak lock" → "peek lock" typo in log templates and method names - Fix batches.Count() always returning 0 by using the actual batch collection; remove unused local variable - Double space in "Preparing to send" was already corrected Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
9bfbb13 to
fd7ab78
Compare
There was a problem hiding this comment.
Code Health Improved
(1 files improve in Code Health)
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
View Improvements
| File | Code Health Impact | Categories Improved |
|---|---|---|
| AzureServiceBusMesssageCreator.cs | 8.82 → 9.10 | Code Duplication |
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Logger.Log*()calls to[LoggerMessage]source-generated methods, matching the pattern already used in the other 6 files in the projectpartialkeyword and nestedprivate static partial class LogtoAzureServiceBusConsumer,AzureServiceBusMessageProducer, andAzureServiceBusMesssageCreatorCloses #3965
Test plan
dotnet build src/Paramore.Brighter.MessagingGateway.AzureServiceBus/— 0 errors, 0 warningsdotnet test tests/Paramore.Brighter.AzureServiceBus.Tests/— 101/101 unit tests pass (10 integration tests skipped, require live ASB)Logger.Log*ors_logger.Log*runtime calls in the ASB project🤖 Generated with Claude Code