waives / waives.net

The .NET SDK for Waives
https://docs.waives.io/docs/dotnet-sdk-overview
MIT License
0 stars 0 forks source link

Migrate logging abstraction to liblog #78

Closed alastairs closed 5 years ago

alastairs commented 5 years ago

This PR replaces Waives.Http.Logging with LibLog, as identified following the spike #71.

The tests are written with a few helper functions (mostly fluent assertion-style extension methods). The Logger.CaptureTo() function sets up a correlation ID for each test, adds that as a property on the log events written during that test's execution, and filters the Serilog.Sinks.Observable to only the events with that correlation ID. This approach was inspired by @damianh's recommendations for testing log output and @sandermvanvliet's fluent assertions for his in-memory Serilog sink.

Fixes #77.

alastairs commented 5 years ago

Thanks @phildrip. What do you mean by "explicitly configure logging"?

phildrip commented 5 years ago

as in, tell liblog to log to the console, instead of serilog, or log4net etc

alastairs commented 5 years ago

Oh, gotcha. You'd need to implement Waives.Http.Logging.ILog, but it's a single method interface with a fairly clear signature.