microsoft / testfx

MSTest framework and adapter
MIT License
714 stars 253 forks source link

Improve logging APIs #3517

Open Evangelink opened 1 month ago

Evangelink commented 1 month ago

Summary

Copy logging extensions (formatting part) from Microsoft.Extensions.Logging.Abstractions to support the template pattern LogInfo("message {a}", val);

Specifically, let's look at https://github.com/dotnet/runtime/blob/a0fca440cc8f820691ce9b379e8ad8c8ca747f1d/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/LogValuesFormatter.cs https://github.com/dotnet/runtime/blob/a0fca440cc8f820691ce9b379e8ad8c8ca747f1d/src/libraries/Microsoft.Extensions.Logging.Abstractions/src/FormattedLogValues.cs

Evangelink commented 2 weeks ago

While in theory this feature is interesting, it will be challenging to bring for netfx (netstandard) because of limited access to span and other runtime APIs that allow efficient accessing.