destructurama / attributed

Use attributes to control how complex types are logged to Serilog.
Apache License 2.0
263 stars 32 forks source link

LogReplaced default value #42

Closed daniel-white closed 2 years ago

daniel-white commented 4 years ago

Regex.Replace(string, string, string, RegexOptions) returns the source string if it isn't a match. Is there a way that the LogReplaced have a fallback in the event it doesn't match.

Also, might be good to specify a timeout on the call to .Replace.

SimonCropp commented 3 years ago

Looks good. can u submit a PR?

sungam3r commented 2 years ago

See #42. I added timeout but not fallback. The timeout behavior is obvious but fallback may be some custom Func so I think that it will be better to write your own class implementing IPropertyDestructuringAttribute.