Skip to content

Clarify AddFilter parameter documentation#124002

Merged
stephentoub merged 3 commits intomainfrom
copilot/update-addfilter-func-docs
Feb 4, 2026
Merged

Clarify AddFilter parameter documentation#124002
stephentoub merged 3 commits intomainfrom
copilot/update-addfilter-func-docs

Conversation

Copy link
Contributor

Copilot AI commented Feb 4, 2026

  • Locate and review FilterLoggingBuilderExtensions.cs
  • Understand the filter function parameters (provider type, category name, log level)
  • Review how filters are invoked in LoggerInformation.cs
  • Update XML documentation for AddFilter methods with Func<string?, string?, LogLevel, bool>
  • Update XML documentation for AddFilter methods with Func<string?, LogLevel, bool>
  • Update XML documentation for LoggerFilterOptions.AddFilter methods
  • Add detailed documentation for all levelFilter parameters (8 methods)
  • Fix incorrect ILoggingBuilder references in LoggerFilterOptions methods
  • Validate XML documentation syntax
  • All changes complete and ready for review
Original prompt

This section details on the original issue you should resolve

<issue_title>Explanation of AddFilter Func string params</issue_title>
<issue_description>For users of Microsoft.Extensions.Logging, it is not clear what string? parameter means when implementing custom filtering rules using FilterLoggingBuilderExtensions.AddFilter:

Image

It would be nice to have some better comment on these methods. Docs here for this particular overload also do not tell much.</issue_description>

<agent_instructions>Research the purpose of these methods and specifically what this argument does, then augment the XML documentation for the methods to better reflect their purpose. Focus on parameter descriptions and remarks. Avoid code samples.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Improve documentation for AddFilter function parameters Clarify AddFilter parameter documentation Feb 4, 2026
Copilot AI requested a review from stephentoub February 4, 2026 13:20
@stephentoub stephentoub marked this pull request as ready for review February 4, 2026 13:29
Copilot AI review requested due to automatic review settings February 4, 2026 13:29
@stephentoub stephentoub enabled auto-merge (squash) February 4, 2026 13:30
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-extensions-logging
See info in area-owners.md if you want to be subscribed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Improves the XML documentation for FilterLoggingBuilderExtensions.AddFilter overloads to clarify what the string? parameters represent and what the filter delegate’s return value means.

Changes:

  • Expanded <param> documentation for Func<string?, string?, LogLevel, bool> and Func<string?, LogLevel, bool> overloads to describe provider type full name vs. category name.
  • Added <remarks> sections with bullet lists and concrete examples of parameter values.
  • Clarified return semantics (true allows logging, false filters out).

@tarekgh tarekgh added the documentation Documentation bug or enhancement, does not impact product or test code label Feb 4, 2026
@tarekgh tarekgh added this to the 11.0.0 milestone Feb 4, 2026
auto-merge was automatically disabled February 4, 2026 15:02

Head branch was pushed to by a user without write access

Copilot AI requested a review from tarekgh February 4, 2026 15:03
@tarekgh
Copy link
Member

tarekgh commented Feb 4, 2026

/ba-g failures are un-related timeout issue.

@stephentoub stephentoub merged commit 4433efd into main Feb 4, 2026
86 of 88 checks passed
@stephentoub stephentoub deleted the copilot/update-addfilter-func-docs branch February 4, 2026 22:22
lewing pushed a commit to lewing/runtime that referenced this pull request Feb 9, 2026
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: stephentoub <[email protected]>
Co-authored-by: tarekgh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Extensions-Logging documentation Documentation bug or enhancement, does not impact product or test code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Explanation of AddFilter Func string params

4 participants