Open Evangelink opened 1 month ago
Copy logging extensions (formatting part) from Microsoft.Extensions.Logging.Abstractions to support the template pattern LogInfo("message {a}", val);
Microsoft.Extensions.Logging.Abstractions
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
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.
Summary
Copy logging extensions (formatting part) from
Microsoft.Extensions.Logging.Abstractions
to support the template patternLogInfo("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