Skip to content

Add diagnostics to PXTrace.Write* methods #435

@SENya1990

Description

@SENya1990

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requeststatic analysisItems related to static code analysis

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions