Skip to content

fix(log): store ConsoleLogProvider adapter per instance and fix CategoryLogFilter docs - #1112

Open
EnesKartal wants to merge 1 commit into
guibranco:mainfrom
EnesKartal:fix/issue-1041
Open

EnesKartal wants to merge 1 commit into
guibranco:mainfrom
EnesKartal:fix/issue-1041

Conversation

@EnesKartal

@EnesKartal EnesKartal commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1041

Summary

  • ConsoleLogProvider: Store _adapter as an instance
    eadonly field instead of a static field so each ConsoleLogProvider instance writes through the IConsoleLogAdapter passed to its constructor.
  • CategoryLogFilter: Update the XML documentation on isExclusive, , and of Filter to accurately describe that rue allows a message through, isExclusive = true excludes the listed categories, and non-matching provider types always pass through.
  • Added unit tests verifying that multiple ConsoleLogProvider instances use their own adapters and verifying CategoryLogFilter behavior.

Summary by Sourcery

Make console logging adapters instance-specific and align CategoryLogFilter documentation and tests with its actual behavior.

Bug Fixes:

  • Ensure each ConsoleLogProvider instance uses the console adapter supplied to its constructor.
  • Correct CategoryLogFilter documentation to reflect its filtering behavior and return value.

Tests:

  • Add coverage for independent ConsoleLogProvider adapters and CategoryLogFilter inclusion and exclusion behavior.

@sourcery-ai

sourcery-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

API

Correct CategoryLogFilter’s public documentation to describe its provider and category pass-through behavior.

  • Src/CrispyWaffle/Log/Filters/CategoryLogFilter.cs L16, L47-52

Implementation

Make each ConsoleLogProvider retain and use the adapter supplied to its own constructor, and update the provider documentation to match.

  • Src/CrispyWaffle/Log/Providers/ConsoleLogProvider.cs L9-27 (7 small edits)

Tests

Add tests for per-instance console adapters and CategoryLogFilter’s category and provider matching behavior.

  • Tests/CrispyWaffle.Tests/Log/Providers/ConsoleLogProviderAndCategoryLogFilterTests.cs L1-48

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai

coderabbitai Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 52 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 45fd73be-8a8d-4a60-ac13-24f69707904a
Commits

Reviewing files that changed from the base of the PR and between f32b265 and 8ad42a0.

Files selected for processing: 3

  • Src/CrispyWaffle/Log/Filters/CategoryLogFilter.cs
  • Src/CrispyWaffle/Log/Providers/ConsoleLogProvider.cs
  • Tests/CrispyWaffle.Tests/Log/Providers/ConsoleLogProviderAndCategoryLogFilterTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@gstraccini gstraccini Bot added log 🐛 bug Issues related to bugs or errors labels Nov 19, 2026
@gstraccini
gstraccini Bot requested a review from guibranco November 19, 2026 15:24
@gstraccini gstraccini Bot added the 🚦 awaiting triage Items that are awaiting triage or categorization label Nov 19, 2026

@sourcery-ai sourcery-ai 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.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

/// </remarks>
/// <param name="provider">The provider type to filter logs by. If <c>null</c>, no provider type filter will be applied.</param>
/// <param name="isExclusive">If set to <c>true</c>, the filter will only allow logs from the specified categories. If set to <c>false</c>, all categories except those specified will be allowed.</param>
/// <param name="isExclusive">If set to <c>true</c>, the filter will exclude logs from the specified categories and allow all others. If set to <c>false</c>, only logs from the specified categories will be allowed.</param>
@@ -0,0 +1,48 @@
using CrispyWaffle.Log;
@@ -0,0 +1,48 @@
using CrispyWaffle.Log;

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚦 awaiting triage Items that are awaiting triage or categorization 🐛 bug Issues related to bugs or errors log

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ConsoleLogProvider and CategoryLogFilter: later providers ignore their adapter; filter docs describe inverted behavior

3 participants