Use LoggerMessage.Define overloads that disable the IsEnabled check #31332
Labels
area-mvc
Includes: MVC, Actions and Controllers, Localization, CORS, most templates
area-networking
Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
Milestone
Depends on dotnet/runtime#45290
There are some places that benefit from this change.
Everywhere logger.IsEnabled is checked, can profit by removing the double-check.
Then there are some places where "heavier objects" need to be created, even if logging is disabled for that level.
(Can use this regex search).
Just from the first results-page (didn't check all / exhaustive) e.g.:
aspnetcore/src/Mvc/Mvc.ViewFeatures/src/MvcViewFeaturesLoggerExtensions.cs
Lines 138 to 139 in 155f402
The text was updated successfully, but these errors were encountered: