Skip to content

Debug logging should be opt-in rather than opt-out #9

@jr01

Description

@jr01

First, thank you for this excellent library! We're close to using Infidex for knowledge base search in production 😄

Issue
The FusionScorer class (and possibly other internal classes) has a static field EnableDebugLogging that defaults to true, causing verbose debug output to be written directly to Console.WriteLine during search operations. This pollutes application logs.

Expected behavior
Debug logging should be opt-in rather than opt-out.

Suggestion
Many .NET libraries follow the convention that diagnostic output should be opt-in or integrate with the host application's logging system (e.g., via ILogger<T> or Microsoft.Extensions.Logging). Direct Console.WriteLine calls bypass log filtering, structured logging, and log routing.

Current workaround

var fusionScorerType = Type.GetType("Infidex.Scoring.FusionScorer, Infidex");
var field = fusionScorerType?.GetField("EnableDebugLogging", BindingFlags.Static | BindingFlags.NonPublic);
field?.SetValue(null, false);

Environment: Infidex 1.0.8, .NET 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions