You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using LoggerMessage attribute today required each logging method to have a unique event ID in a given class.
Otherwise, we get a warning SYSLIB1006, stating we should not be reusing event IDs.
This issue tracks allowing uses of the LoggerMessage attribute without defining an event ID, but, adding a Roslyn Analyzer that warns/errors to recommend best practices.
This is more useful for library developers than it is for app developers which most times might want to cut corners and skip providing event IDs.
When event ID is not set, it will default to -1, when multiple logging methods in a class don't have event ID set, they all default to -1, causing the SYSLIB1006 warning.
The text was updated successfully, but these errors were encountered:
Using LoggerMessage attribute today required each logging method to have a unique event ID in a given class.
Otherwise, we get a warning SYSLIB1006, stating we should not be reusing event IDs.
This issue tracks allowing uses of the LoggerMessage attribute without defining an event ID, but, adding a Roslyn Analyzer that warns/errors to recommend best practices.
This is more useful for library developers than it is for app developers which most times might want to cut corners and skip providing event IDs.
Using LoggerMessage attribute today required each logging method to have a unique event ID in a given class.
Otherwise, we get a warning
SYSLIB1006
, stating we should not be reusing event IDs.This issue tracks allowing uses of the LoggerMessage attribute without defining an event ID, but, adding a Roslyn Analyzer that warns/errors to recommend best practices.
This is more useful for library developers than it is for app developers which most times might want to cut corners and skip providing event IDs.
Originally requested in dotnet/designs#195 (comment).
cc: @loic-sharma @shirhatti
UPDATE
How to address:
When event ID is not set, it will default to -1, when multiple logging methods in a class don't have event ID set, they all default to -1, causing the
SYSLIB1006
warning.The text was updated successfully, but these errors were encountered: