serilog / serilog-expressions

An embeddable mini-language for filtering, enriching, and formatting Serilog events, ideal for use with JSON or XML configuration.
Apache License 2.0
193 stars 17 forks source link

Improve function parameter resolution #42

Closed nblumhardt closed 3 years ago

nblumhardt commented 3 years ago

User-defined functions can currently accept IFormatProvider and StringComparison parameters, along with the LogEventPropertyValues supplied via the expression.

The resolution logic is very basic, and only works if the "special" parameters are in the first position.

It would be great if LogEvent parameters can also be bound, and also, if NameResolver could supply additional (constant) values to bind to other arguments. Adding these things would provide a great opportunity to generalize how the expression compiler binds function parameters.

nblumhardt commented 3 years ago

Released in 3.1.0; see #43