Eliminate enum boxing allocations from Kestrel HTTP2 logging (#19277)
This commit is contained in:
parent
e0793fda6c
commit
d4ed4f7050
|
|
@ -272,12 +272,18 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
|
|||
|
||||
public void Http2FrameReceived(string connectionId, Http2Frame frame)
|
||||
{
|
||||
_http2FrameReceived(_logger, connectionId, frame.Type, frame.StreamId, frame.PayloadLength, frame.ShowFlags(), null);
|
||||
if (_logger.IsEnabled(LogLevel.Trace))
|
||||
{
|
||||
_http2FrameReceived(_logger, connectionId, frame.Type, frame.StreamId, frame.PayloadLength, frame.ShowFlags(), null);
|
||||
}
|
||||
}
|
||||
|
||||
public void Http2FrameSending(string connectionId, Http2Frame frame)
|
||||
{
|
||||
_http2FrameSending(_logger, connectionId, frame.Type, frame.StreamId, frame.PayloadLength, frame.ShowFlags(), null);
|
||||
if (_logger.IsEnabled(LogLevel.Trace))
|
||||
{
|
||||
_http2FrameSending(_logger, connectionId, frame.Type, frame.StreamId, frame.PayloadLength, frame.ShowFlags(), null);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Log<TState>(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
|
||||
|
|
|
|||
Loading…
Reference in New Issue