Skip to content

Add log level check before logging persistent container warning#14496

Merged
DamianEdwards merged 2 commits intosebros/persistentdbfrom
copilot/sub-pr-14491
Feb 13, 2026
Merged

Add log level check before logging persistent container warning#14496
DamianEdwards merged 2 commits intosebros/persistentdbfrom
copilot/sub-pr-14491

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Description

Adds IsEnabled(LogLevel.Warning) guard before logging in WarnPersistentContainersWithoutUserSecrets to avoid unnecessary string formatting overhead when warning level is disabled.

// Before
logger.LogWarning(MessageStrings.PersistentContainerWithoutUserSecrets, resource.Name);

// After
if (logger.IsEnabled(LogLevel.Warning))
{
    logger.LogWarning(MessageStrings.PersistentContainerWithoutUserSecrets, resource.Name);
}

This aligns with the logging pattern used throughout the codebase (e.g., AuxiliaryBackchannelRpcTarget, DashboardEventHandlers).

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: DamianEdwards <249088+DamianEdwards@users.noreply.github.com>
Copilot AI changed the title [WIP] Update warning log level for persistent containers config Add log level check before logging persistent container warning Feb 13, 2026
Copilot AI requested a review from DamianEdwards February 13, 2026 20:38
@DamianEdwards DamianEdwards marked this pull request as ready for review February 13, 2026 20:38
@DamianEdwards DamianEdwards merged commit 64b7737 into sebros/persistentdb Feb 13, 2026
3 of 4 checks passed
@DamianEdwards DamianEdwards deleted the copilot/sub-pr-14491 branch February 13, 2026 20:38
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.

2 participants