Skip to content

Commit 6c5e668

Browse files
authored
Remove IKestrelTrace (#37242)
1 parent 7dffb0b commit 6c5e668

File tree

59 files changed

+405
-906
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+405
-906
lines changed

src/Servers/Kestrel/Core/src/Internal/ConnectionDispatcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ConnectionDispatcher(ServiceContext serviceContext, Func<T, Task> connect
2424
_transportConnectionManager = transportConnectionManager;
2525
}
2626

27-
private IKestrelTrace Log => _serviceContext.Log;
27+
private KestrelTrace Log => _serviceContext.Log;
2828

2929
public Task StartAcceptingConnections(IConnectionListener<T> listener)
3030
{

src/Servers/Kestrel/Core/src/Internal/Http/Http1OutputProducer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal class Http1OutputProducer : IHttpOutputProducer, IDisposable
3434
private readonly string _connectionId;
3535
private readonly BaseConnectionContext _connectionContext;
3636
private readonly MemoryPool<byte> _memoryPool;
37-
private readonly IKestrelTrace _log;
37+
private readonly KestrelTrace _log;
3838
private readonly IHttpMinResponseDataRateFeature _minResponseDataRateFeature;
3939
private readonly IHttpOutputAborter _outputAborter;
4040
private readonly TimingPipeFlusher _flusher;
@@ -78,7 +78,7 @@ public Http1OutputProducer(
7878
string connectionId,
7979
BaseConnectionContext connectionContext,
8080
MemoryPool<byte> memoryPool,
81-
IKestrelTrace log,
81+
KestrelTrace log,
8282
ITimeoutControl timeoutControl,
8383
IHttpMinResponseDataRateFeature minResponseDataRateFeature,
8484
IHttpOutputAborter outputAborter)

src/Servers/Kestrel/Core/src/Internal/Http/HttpProtocol.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public void Initialize(HttpConnectionContext context)
101101
public IFeatureCollection ConnectionFeatures => _context.ConnectionFeatures;
102102
public IHttpOutputProducer Output { get; protected set; } = default!;
103103

104-
protected IKestrelTrace Log => ServiceContext.Log;
104+
protected KestrelTrace Log => ServiceContext.Log;
105105
private DateHeaderValueManager DateHeaderValueManager => ServiceContext.DateHeaderValueManager;
106106
// Hold direct reference to ServerOptions since this is used very often in the request processing path
107107
protected KestrelServerOptions ServerOptions { get; set; } = default!;

src/Servers/Kestrel/Core/src/Internal/Http/MessageBody.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected MessageBody(HttpProtocol context)
4242

4343
public virtual bool IsEmpty => false;
4444

45-
protected IKestrelTrace Log => _context.ServiceContext.Log;
45+
protected KestrelTrace Log => _context.ServiceContext.Log;
4646

4747
public abstract ValueTask<ReadResult> ReadAsync(CancellationToken cancellationToken = default);
4848

src/Servers/Kestrel/Core/src/Internal/Http2/Http2Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public Http2Connection(HttpConnectionContext context)
139139

140140
public PipeReader Input => _input.Reader;
141141

142-
public IKestrelTrace Log => _context.ServiceContext.Log;
142+
public KestrelTrace Log => _context.ServiceContext.Log;
143143
public IFeatureCollection ConnectionFeatures => _context.ConnectionFeatures;
144144
public ISystemClock SystemClock => _context.ServiceContext.SystemClock;
145145
public ITimeoutControl TimeoutControl => _context.TimeoutControl;

src/Servers/Kestrel/Core/src/Internal/Http2/Http2FrameWriter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal class Http2FrameWriter
3434
private readonly Http2Connection _http2Connection;
3535
private readonly OutputFlowControl _connectionOutputFlowControl;
3636
private readonly string _connectionId;
37-
private readonly IKestrelTrace _log;
37+
private readonly KestrelTrace _log;
3838
private readonly ITimeoutControl _timeoutControl;
3939
private readonly MinDataRate? _minResponseDataRate;
4040
private readonly TimingPipeFlusher _flusher;

src/Servers/Kestrel/Core/src/Internal/Http2/Http2OutputProducer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ internal class Http2OutputProducer : IHttpOutputProducer, IHttpOutputAborter, IV
2323
private int StreamId => _stream.StreamId;
2424
private readonly Http2FrameWriter _frameWriter;
2525
private readonly TimingPipeFlusher _flusher;
26-
private readonly IKestrelTrace _log;
26+
private readonly KestrelTrace _log;
2727

2828
// This should only be accessed via the FrameWriter. The connection-level output flow control is protected by the
2929
// FrameWriter's connection-level write lock.

src/Servers/Kestrel/Core/src/Internal/Http3/Http3Connection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private void UpdateHighestOpenedRequestStreamId(long streamId)
8383
// https://quicwg.org/base-drafts/draft-ietf-quic-http.html#section-5.2-2
8484
private long GetCurrentGoAwayStreamId() => Interlocked.Read(ref _highestOpenedRequestStreamId) + 4;
8585

86-
private IKestrelTrace Log => _context.ServiceContext.Log;
86+
private KestrelTrace Log => _context.ServiceContext.Log;
8787
public KestrelServerLimits Limits => _context.ServiceContext.ServerOptions.Limits;
8888
public Http3ControlStream? OutboundControlStream { get; set; }
8989
public Http3ControlStream? ControlStream { get; set; }

src/Servers/Kestrel/Core/src/Internal/Http3/Http3ControlStream.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void OnStreamClosed()
6565
}
6666

6767
public PipeReader Input => _context.Transport.Input;
68-
public IKestrelTrace Log => _context.ServiceContext.Log;
68+
public KestrelTrace Log => _context.ServiceContext.Log;
6969

7070
public long StreamTimeoutTicks { get; set; }
7171
public bool IsReceivingHeader => _headerType == -1;

src/Servers/Kestrel/Core/src/Internal/Http3/Http3FrameWriter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ internal class Http3FrameWriter
4141
private readonly ITimeoutControl _timeoutControl;
4242
private readonly MinDataRate? _minResponseDataRate;
4343
private readonly MemoryPool<byte> _memoryPool;
44-
private readonly IKestrelTrace _log;
44+
private readonly KestrelTrace _log;
4545
private readonly IStreamIdFeature _streamIdFeature;
4646
private readonly IHttp3Stream _http3Stream;
4747
private readonly Http3RawFrame _outgoingFrame;
@@ -61,7 +61,7 @@ internal class Http3FrameWriter
6161
private bool _completed;
6262
private bool _aborted;
6363

64-
public Http3FrameWriter(ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate, MemoryPool<byte> memoryPool, IKestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
64+
public Http3FrameWriter(ConnectionContext connectionContext, ITimeoutControl timeoutControl, MinDataRate? minResponseDataRate, MemoryPool<byte> memoryPool, KestrelTrace log, IStreamIdFeature streamIdFeature, Http3PeerSettings clientPeerSettings, IHttp3Stream http3Stream)
6565
{
6666
_connectionContext = connectionContext;
6767
_timeoutControl = timeoutControl;

src/Servers/Kestrel/Core/src/Internal/Http3/Http3OutputProducer.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ internal class Http3OutputProducer : IHttpOutputProducer, IHttpOutputAborter
2121
{
2222
private readonly Http3FrameWriter _frameWriter;
2323
private readonly TimingPipeFlusher _flusher;
24-
private readonly IKestrelTrace _log;
24+
private readonly KestrelTrace _log;
2525
private readonly MemoryPool<byte> _memoryPool;
2626
private readonly Http3Stream _stream;
2727
private readonly Pipe _pipe;
@@ -40,7 +40,7 @@ public Http3OutputProducer(
4040
Http3FrameWriter frameWriter,
4141
MemoryPool<byte> pool,
4242
Http3Stream stream,
43-
IKestrelTrace log)
43+
KestrelTrace log)
4444
{
4545
_frameWriter = frameWriter;
4646
_memoryPool = pool;

src/Servers/Kestrel/Core/src/Internal/HttpConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public HttpConnection(BaseHttpConnectionContext context)
4545
_context.TimeoutControl ??= _timeoutControl;
4646
}
4747

48-
private IKestrelTrace Log => _context.ServiceContext.Log;
48+
private KestrelTrace Log => _context.ServiceContext.Log;
4949

5050
public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> httpApplication) where TContext : notnull
5151
{

src/Servers/Kestrel/Core/src/Internal/Infrastructure/ConnectionManager.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ internal class ConnectionManager
1212
private long _lastConnectionId = long.MinValue;
1313

1414
private readonly ConcurrentDictionary<long, ConnectionReference> _connectionReferences = new ConcurrentDictionary<long, ConnectionReference>();
15-
private readonly IKestrelTrace _trace;
15+
private readonly KestrelTrace _trace;
1616

17-
public ConnectionManager(IKestrelTrace trace, long? upgradedConnectionLimit)
17+
public ConnectionManager(KestrelTrace trace, long? upgradedConnectionLimit)
1818
: this(trace, GetCounter(upgradedConnectionLimit))
1919
{
2020
}
2121

22-
public ConnectionManager(IKestrelTrace trace, ResourceCounter upgradedConnections)
22+
public ConnectionManager(KestrelTrace trace, ResourceCounter upgradedConnections)
2323
{
2424
UpgradedConnectionCount = upgradedConnections;
2525
_trace = trace;

src/Servers/Kestrel/Core/src/Internal/Infrastructure/Heartbeat.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ internal class Heartbeat : IDisposable
1414
private readonly IHeartbeatHandler[] _callbacks;
1515
private readonly ISystemClock _systemClock;
1616
private readonly IDebugger _debugger;
17-
private readonly IKestrelTrace _trace;
17+
private readonly KestrelTrace _trace;
1818
private readonly TimeSpan _interval;
1919
private readonly Thread _timerThread;
2020
private volatile bool _stopped;
2121

22-
public Heartbeat(IHeartbeatHandler[] callbacks, ISystemClock systemClock, IDebugger debugger, IKestrelTrace trace)
22+
public Heartbeat(IHeartbeatHandler[] callbacks, ISystemClock systemClock, IDebugger debugger, KestrelTrace trace)
2323
{
2424
_callbacks = callbacks;
2525
_systemClock = systemClock;

src/Servers/Kestrel/Core/src/Internal/Infrastructure/IKestrelTrace.cs

Lines changed: 0 additions & 105 deletions
This file was deleted.

src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelConnection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ internal abstract class KestrelConnection : IConnectionHeartbeatFeature, IConnec
2828
public KestrelConnection(long id,
2929
ServiceContext serviceContext,
3030
TransportConnectionManager transportConnectionManager,
31-
IKestrelTrace logger)
31+
KestrelTrace logger)
3232
{
3333
_id = id;
3434
_serviceContext = serviceContext;
@@ -38,7 +38,7 @@ public KestrelConnection(long id,
3838
ConnectionClosedRequested = _connectionClosingCts.Token;
3939
}
4040

41-
protected IKestrelTrace Logger { get; }
41+
protected KestrelTrace Logger { get; }
4242

4343
public CancellationToken ConnectionClosedRequested { get; set; }
4444
public Task ExecutionTask => _completionTcs.Task;

src/Servers/Kestrel/Core/src/Internal/Infrastructure/KestrelConnectionOfT.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public KestrelConnection(long id,
2020
TransportConnectionManager transportConnectionManager,
2121
Func<T, Task> connectionDelegate,
2222
T connectionContext,
23-
IKestrelTrace logger)
23+
KestrelTrace logger)
2424
: base(id, serviceContext, transportConnectionManager, logger)
2525
{
2626
_connectionDelegate = connectionDelegate;

0 commit comments

Comments
 (0)