Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add diagnostics to PXTrace.Write* methods #435

Open
SENya1990 opened this issue Apr 18, 2022 · 0 comments
Open

Add diagnostics to PXTrace.Write* methods #435

SENya1990 opened this issue Apr 18, 2022 · 0 comments
Labels
enhancement New feature or request static analysis Items related to static code analysis

Comments

@SENya1990
Copy link
Contributor

Internal number: ATR-356

Please add diagnostics to PXTrace.Write* methods to enforce proper usage. The desired diagnostics can be seen in SerilogAnalyzer, but the most important one is Constant Message Template Verifier:

Check that message templates are constant strings. This ensures that events with different data/format arguments can still be detected as instances of the same event.

    var errorMessage = TryToCheckOutOrder(...);
    PXTrace.WriteError(errorMessage);

Because errorMessage generally contains failure-specific text ("Couldn't find order 123" ... then 124, then 125) the group of occurrences can't be located using the message template/event type.

@SENya1990 SENya1990 added enhancement New feature or request static analysis Items related to static code analysis labels Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request static analysis Items related to static code analysis
Projects
None yet
Development

No branches or pull requests

1 participant