Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging should be done with same log level used in condition and log statement #501

Open
RalfKoban opened this issue Jul 4, 2022 · 0 comments

Comments

@RalfKoban
Copy link
Owner

We should report a warning if a log method is invoked inside an if block but does have a different log level than the one checked inside the if block.

E.g.:
Following should report a warning:

if (Log.IsInfoEnabled)
{
    Log.Debug("something");
}

In addition, following should report a warning:

if (Log.IsDebugEnabled)
{
    Log.Info("something");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
MiKo Analyzers
  
Backlog
Development

No branches or pull requests

1 participant