Skip to content

Commit 458d243

Browse files
committed
quic: proper custom inspect for QuicStream
PR-URL: #34247 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 0860b11 commit 458d243

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

lib/internal/quic/core.js

+4-11
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const {
4444
QuicSessionSharedState,
4545
QLogStream,
4646
} = require('internal/quic/util');
47-
const util = require('util');
4847
const assert = require('internal/assert');
4948
const EventEmitter = require('events');
5049
const fs = require('fs');
@@ -2713,23 +2712,17 @@ class QuicStream extends Duplex {
27132712
// TODO(@jasnell): Implement this
27142713
}
27152714

2716-
[kInspect]() {
2715+
[kInspect](depth, options) {
27172716
// TODO(@jasnell): Proper custom inspect implementation
27182717
const direction = this.bidirectional ? 'bidirectional' : 'unidirectional';
27192718
const initiated = this.serverInitiated ? 'server' : 'client';
2720-
const obj = {
2719+
return customInspect(this, {
27212720
id: this[kInternalState].id,
27222721
direction,
27232722
initiated,
27242723
writableState: this._writableState,
2725-
readableState: this._readableState,
2726-
stats: {
2727-
dataRate: this.dataRateHistogram,
2728-
dataSize: this.dataSizeHistogram,
2729-
dataAck: this.dataAckHistogram,
2730-
}
2731-
};
2732-
return `QuicStream ${util.format(obj)}`;
2724+
readableState: this._readableState
2725+
}, depth, options);
27332726
}
27342727

27352728
[kTrackWriteState](stream, bytes) {

0 commit comments

Comments
 (0)