u/Fragrant-Training722

▲ 19 r/dotnet

Log methods evaluation expensive warning and wrapping with IF

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:

https://preview.redd.it/maffgqy8qakh1.png?width=705&format=png&auto=webp&s=099656d48dc09e4a71e2deec9c61cd419fbcd24f

reddit.com
u/Fragrant-Training722 — 2 days ago