Skip to content

Commit 0860b11

Browse files
committed
quic: proper custom inspect for QuicSession
PR-URL: #34247 Reviewed-By: Anna Henningsen <[email protected]>
1 parent b047930 commit 0860b11

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

lib/internal/quic/core.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,10 +1777,9 @@ class QuicSession extends EventEmitter {
17771777
stream[kStreamReset](code);
17781778
}
17791779

1780-
[kInspect]() {
1781-
// TODO(@jasnell): A proper custom inspect implementation
1780+
[kInspect](depth, options) {
17821781
const state = this[kInternalState];
1783-
const obj = {
1782+
return customInspect(this, {
17841783
alpn: state.alpn,
17851784
cipher: this.cipher,
17861785
closing: this.closing,
@@ -1790,12 +1789,7 @@ class QuicSession extends EventEmitter {
17901789
maxStreams: this.maxStreams,
17911790
servername: this.servername,
17921791
streams: state.streams.size,
1793-
stats: {
1794-
handshakeAck: this.handshakeAckHistogram,
1795-
handshakeContinuation: this.handshakeContinuationHistogram,
1796-
}
1797-
};
1798-
return `${this.constructor.name} ${util.format(obj)}`;
1792+
}, depth, options);
17991793
}
18001794

18011795
[kSetSocket](socket) {

0 commit comments

Comments
 (0)