-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Performance] Boxing in OpenTelemetryLogger #1834
Comments
We cannot break the public API (in this case, it is the SDK package) within version 1.x. |
I figured you would say that 😄
I don't think that will work, because the ILogger interface is generic: public void Log<TState> (Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, Exception exception, Func<TState,Exception,string> formatter); I have a couple ideas let me mess with it and I'll reply back. Could we unseal |
Looks like you're right. I will take a look at the code and see if I have other ideas.
Yes we could! Unseal a class is not considered as a breaking change 😄 |
@reyang OK I pushed a potential solution to #1833 check it out and let me know what you think. It's tricky you really have to process the |
We have
State
as an object onLogRecord
:The main
ILogger
extensions (eg LogInformation, LogWarning, etc.) all flow through a single method which uses struct FormattedLogValues to store the state.So that
object State
will cause a lot of boxing for users.There are solutions to this, but it would be breaking. So @reyang @cijothomas @alanwest are we open to breaking the log API in order to fix this?
The text was updated successfully, but these errors were encountered: