Skip to content

Output template processing improvements #958

@nblumhardt

Description

@nblumhardt

#944 adds new functionality to output templates, in the form of {Properties} support.

Serilog.Sinks.Literate, the primary external consumer of OutputProperties.GetOutputProperties(), can't make use of the new functionality directly - in order to pretty-print the property object it needs to reimplement a lot of the logic there.

This leaves us at a good point to make some changes:

  • Break the literate console sink's dependency on OutputProperties.GetOutputProperties() entirely, copying some implementation across if we have to
  • Make the newly-added GetOutputProperties() overload internal
  • Mark the old GetOutputProperties() method obsolete
  • Rewrite MessageTemplateTextFormatter to avoid all of the unnecessary allocations that it currently makes via GetOutputProperties(); we can consider Allow "string quoting" to be overridden at the output template level #956 in the process

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions