Skip to content

Fix CA1873 warnings by using LoggerMessageAttribute #354

Description

@udlose

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendCovers changes, bug fixes, and improvements to the backend implementation.good first issueGood for newcomersperformanceOptimization of speed or memory allocationrefactoringChanges related to refactoring existing functionality

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions