Skip to content

Logging: disable IncludeScopes/IncludeActivity for the MEL.Spectre provider #3556

Description

@thomhurst

Category: logging correctness/perf — Breaking: no

DependencyInjectionSetup.ConfigureSpectreConsoleLogger never sets IncludeScopes/IncludeActivity (both default true in MEL.Spectre). Buffered module logs are replayed at flush time (ModuleOutputBuffer.cs:478 logEvent.WriteTo(logger)) where the original scope's AsyncLocal context is gone, so scopes never render usefully — but a pipeline-level BeginScope (PipelineLevelLogger.cs:39 forwards it) makes the GHA renderer emit ::group:: (Spectre.MEL GitHubActionsRenderer.cs:158-166) that can interleave with ModularPipelines' own non-nestable groups. Meanwhile every log call pays the scope-capture List+array allocation (Spectre.MEL SpectreConsoleLogger.cs:67-85).

Fix: set config.IncludeScopes = false (and consider IncludeActivity = false) in ConfigureSpectreConsoleLogger — ModularPipelines owns grouping itself.

Part of #3239 (round 2 addendum).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low: hygiene and nice-to-haves - wheneverenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions