Skip to content

Loglevel of undefined features too high #150

@Tornhoof

Description

@Tornhoof

In #140 a functionality was added to throw if features are not defined, additionally a log message with Level Warning was added if the throw flag is not enabled.
This now means, that everyone who has undefined feature flags and uses the method IsEnabledAsync gets a warning log entry.
Is that the expected behaviour?
In one of the products I maintain, I do not define non-relevant Features as false (most features are true/false), but now I received questions from customers why completely unknown features show up as warnings, features they do not know about. I specifically do not define the non-relevant Features as false, as the customers do not need to know them and the list is rather long.

I'm perfectly aware that I can configure the log level to remove the warnings, but the log level is also under customer's control. So what is my solution at the moment?
Instead of just calling IsEnabledAsync(), I call GetFeatureNamesAsync first and do a contains in there too. Which is, from my pov, strange.
Is there a good reason this message has to be warning, maybe @zhenlan can chime in, he suggested the change for it.

You might want to change the example on the main page to include that behavior, in the code snippet for IsEnabledAsync

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions