Skip to content

Latest commit

 

History

History
16 lines (12 loc) · 499 Bytes

File metadata and controls

16 lines (12 loc) · 499 Bytes

Anonymous objects must be destructured

Noncompliant Code Examples:

Log.Error("Processed {Position}", new { x = 4, y = 2});

Compliant Solution:

Log.Error("Processed {@Position}", new { x = 4, y = 2});

Also applies to custom logging wrappers.

Does not apply to ZLogger 2.x interpolated templates: destructuring is Serilog syntax, ZLogger serializes a value with the :json format specifier instead.