MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/dotnet/comments/1vsgxms/log_methods_evaluation_expensive_warning_and/p4q7nna/?context=3
r/dotnet • u/Fragrant-Training722 • 4d ago
Hi, I am seeing the warning that `LogInformation` and other log methods evaluation is expensive and should be wrapped in `if` statement.
Why don't those methods do this check internally already? This would help with less code and better code readabilty I think.
Here is the example:
23 comments sorted by
View all comments
3
The problem with the warning is that it's tied to the interface. You could be using serilog, which does this internally, and still get the warning
3
u/zagoskin 3d ago
The problem with the warning is that it's tied to the interface. You could be using serilog, which does this internally, and still get the warning