A log call on a hot path can box values, allocate temporary objects, and parse its template at runtime. `LoggerMessageAttribute` generates a strongly typed logging method at compile time instead. https://learn.microsoft.com/dotnet/core/extensions/high-performance-logging
Post
You define the event ID, level, template, and typed parameters on a partial method. The generator writes the implementation. Useful for request pipelines, queue processors, parsers, and loops. Normal `LogInformation` is still fine when the path is cold.
0 reposts0 likes
No replies yet.