Skip to content

feat: switch ASB transport to compile-time logging source generation#4017

Merged
DevJonny merged 2 commits into
BrighterCommand:masterfrom
DevJonny:feature/3965-asb-compile-time-logging
Feb 18, 2026
Merged

feat: switch ASB transport to compile-time logging source generation#4017
DevJonny merged 2 commits into
BrighterCommand:masterfrom
DevJonny:feature/3965-asb-compile-time-logging

Conversation

@DevJonny

Copy link
Copy Markdown
Contributor

Summary

  • 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 other 6 files in the project
  • Adds partial keyword and nested private static partial class Log to AzureServiceBusConsumer, AzureServiceBusMessageProducer, and AzureServiceBusMesssageCreator
  • No changes to log levels, message templates, or parameters — purely a mechanical conversion

Closes #3965

Test plan

  • dotnet build src/Paramore.Brighter.MessagingGateway.AzureServiceBus/ — 0 errors, 0 warnings
  • dotnet test tests/Paramore.Brighter.AzureServiceBus.Tests/ — 101/101 unit tests pass (10 integration tests skipped, require live ASB)
  • Grep confirms no remaining Logger.Log* or s_logger.Log* runtime calls in the ASB project

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings February 17, 2026 19:48
codescene-delta-analysis[bot]

This comment was marked as outdated.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and AzureServiceBusMesssageCreator to [LoggerMessage]-based source-generated methods.
  • Marked the affected types as partial and introduced nested private static partial class Log containers 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.

Comment thread src/Paramore.Brighter.MessagingGateway.AzureServiceBus/AzureServiceBusConsumer.cs Outdated
Comment thread src/Paramore.Brighter.MessagingGateway.AzureServiceBus/AzureServiceBusConsumer.cs Outdated
codescene-delta-analysis[bot]

This comment was marked as outdated.

DevJonny and others added 2 commits February 18, 2026 14:07
…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>
@DevJonny DevJonny force-pushed the feature/3965-asb-compile-time-logging branch from 9bfbb13 to fd7ab78 Compare February 18, 2026 14:07
@DevJonny DevJonny merged commit 8ef09dd into BrighterCommand:master Feb 18, 2026
3 of 6 checks passed

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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.

[Feature] Switch Azure Service Bus to compile tlime logging source generation

5 participants