-
Notifications
You must be signed in to change notification settings - Fork 10
Fix CA1873 warnings by using LoggerMessageAttribute #354
Copy link
Copy link
Open
Labels
backendCovers changes, bug fixes, and improvements to the backend implementation.Covers changes, bug fixes, and improvements to the backend implementation.good first issueGood for newcomersGood for newcomersperformanceOptimization of speed or memory allocationOptimization of speed or memory allocationrefactoringChanges related to refactoring existing functionalityChanges related to refactoring existing functionality
Milestone
Description
Metadata
Metadata
Assignees
Labels
backendCovers changes, bug fixes, and improvements to the backend implementation.Covers changes, bug fixes, and improvements to the backend implementation.good first issueGood for newcomersGood for newcomersperformanceOptimization of speed or memory allocationOptimization of speed or memory allocationrefactoringChanges related to refactoring existing functionalityChanges related to refactoring existing functionality
When logging methods are called, their arguments are evaluated regardless of whether the logging level is enabled. This can result in expensive operations being executed even when the log message won't be written. For better performance, guard expensive logging calls with a check to IsEnabled or use source-generated logging with the LoggerMessageAttribute attribute.
To resolve, use LoggerMessageAttribute attribute with the pattern described here: CA1873: Avoid potentially expensive logging