haf / expecto

A smooth testing lib for F#. APIs made for humans! Strong testing methodologies for everyone!
Apache License 2.0
663 stars 96 forks source link

Use `Microsoft.Extensins.Logging` instead of an internal home brew logging #454

Open xperiandri opened 1 year ago

xperiandri commented 1 year ago

I propose rewriting the logging stack to the standard Microsoft.Extensins.Logging and ILogger class usage to be consistent and support structural logging. Please approve if you agree.

farlee2121 commented 1 year ago

It makes sense to me at a high level, but I don't know enough about the original motivations for using a custom logger.

jwosty commented 11 months ago

I would guess because Microsoft.Extensions.Logging did not exist when Expecto was first built. That, and I can definitely understand wanting to dogfood Logary. @haf is that accurate?

Regardless I also think this is a good idea. I'm usually using MEL ILogger in my own code under test anyway, so I have to use an adapter from the Expecto logger -> ILogger. If Expecto used ILogger directly, I'd be able to remove these adapters. Expecto could also use FSharp.Logf to keep the FSharp-y semantics.

haf commented 11 months ago

Yes, accurate.

sonicbhoc commented 2 months ago

Would Logary also need to implement ILogger to keep the default behavior?