expecto icon indicating copy to clipboard operation
expecto copied to clipboard

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

Open xperiandri opened this issue 2 years ago • 4 comments

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.

xperiandri avatar May 25 '23 13:05 xperiandri

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

farlee2121 avatar Jun 22 '23 15:06 farlee2121

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.

jwosty avatar Jul 11 '23 19:07 jwosty

Yes, accurate.

haf avatar Jul 18 '23 13:07 haf

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

sonicbhoc avatar Apr 05 '24 15:04 sonicbhoc