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

New Rule : detect when passing properties of an anonymous type but forgetting the @ destructuring operator #28

Closed
tsimbalar opened this issue Nov 9, 2017 · 2 comments
Assignees

Comments

@tsimbalar
Copy link

Following the advice from https://nblumhardt.com/2016/02/serilog-tip-dont-serialize-arbitrary-objects/ , it's quite a common pattern to use anonymous classes as a property to enrich a log event. In those case, it's important to remember to add the @ destructuring operator in the message template, or else, the ToString() behavior will be used.

It would be good to detect cases where the user has passed a property of an anonymous type, but forgot to add the @ operator. The code fix would be to add the missing operator in the template.

@Suchiman Suchiman self-assigned this Nov 9, 2017
@Suchiman
Copy link
Owner

Suchiman commented Nov 9, 2017

Sounds good 👍 will implement

@tsimbalar
Copy link
Author

Thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants