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

Optional argument of MessageTemplateTextFormatter is not syntactically optional #1328

Closed
1 of 2 tasks
TysonMN opened this issue Jun 23, 2019 · 1 comment
Closed
1 of 2 tasks

Comments

@TysonMN
Copy link

TysonMN commented Jun 23, 2019

Does this issue relate to a new feature or an existing bug?

  • Bug
  • New Feature

What version of Serilog is affected? Please list the related NuGet package.
2.8.0 (currently the latest)

What is the target framework and operating system? See target frameworks & net standard matrix.

All or NA

Please describe the current behavior?
The only constructor of MessageTemplateTextFormatter requires as its second and last argument a reference to an instance of IFormatProvider. However, the documentation says that this reference is allowed to be null. Indeed, MessageTemplateTextFormatter eventually passes this reference into four functions and all them syntactically specify that a reference to an instance of IFormatProvider is optional by providing the default value null.

Please describe the expected behavior?
I was expecting that the constructor of MessageTemplateTextFormatter would also syntactically specify that a reference to an instance of IFormatProvider is optional by providing the default value null.

If it would be helpful, I can create a PR to resolve this issue.

@nblumhardt
Copy link
Member

Thanks for the note. I think a default = null would make sense, here 👍

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

No branches or pull requests

2 participants