@nxtedition/nxt-undici 6.3.19 → 6.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/interceptor/log.js +4 -11
- package/package.json +1 -1
package/lib/interceptor/log.js
CHANGED
|
@@ -7,7 +7,7 @@ class Handler extends DecoratorHandler {
|
|
|
7
7
|
#abort
|
|
8
8
|
#aborted = false
|
|
9
9
|
#pos = 0
|
|
10
|
-
#created =
|
|
10
|
+
#created = performance.now()
|
|
11
11
|
#timing = {
|
|
12
12
|
created: -1,
|
|
13
13
|
connect: -1,
|
|
@@ -29,9 +29,7 @@ class Handler extends DecoratorHandler {
|
|
|
29
29
|
this.#logger = this.#logger.child(logOpts?.bindings)
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
this.#
|
|
33
|
-
|
|
34
|
-
this.#logger.debug('upstream request queued')
|
|
32
|
+
this.#logger.debug('upstream request started')
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
onConnect(abort) {
|
|
@@ -43,8 +41,6 @@ class Handler extends DecoratorHandler {
|
|
|
43
41
|
this.#timing.data = -1
|
|
44
42
|
this.#timing.end = -1
|
|
45
43
|
|
|
46
|
-
this.#logger.debug('upstream request started')
|
|
47
|
-
|
|
48
44
|
super.onConnect((reason) => {
|
|
49
45
|
this.#aborted = true
|
|
50
46
|
this.#abort(reason)
|
|
@@ -59,7 +55,7 @@ class Handler extends DecoratorHandler {
|
|
|
59
55
|
ures: { statusCode, headers },
|
|
60
56
|
elapsedTime: this.#timing.headers,
|
|
61
57
|
},
|
|
62
|
-
'upstream request
|
|
58
|
+
'upstream request upgrade',
|
|
63
59
|
)
|
|
64
60
|
|
|
65
61
|
socket.on('close', () => {
|
|
@@ -70,10 +66,7 @@ class Handler extends DecoratorHandler {
|
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
onHeaders(statusCode, headers, resume) {
|
|
73
|
-
this.#logger.debug({ ures: { statusCode, headers } }, 'upstream request response')
|
|
74
|
-
|
|
75
69
|
this.#timing.headers = performance.now() - this.#created
|
|
76
|
-
|
|
77
70
|
this.#statusCode = statusCode
|
|
78
71
|
this.#headers = headers
|
|
79
72
|
|
|
@@ -94,6 +87,7 @@ class Handler extends DecoratorHandler {
|
|
|
94
87
|
this.#timing.end = performance.now() - this.#created
|
|
95
88
|
|
|
96
89
|
const data = {
|
|
90
|
+
ureq: this.#opts,
|
|
97
91
|
ures: {
|
|
98
92
|
statusCode: this.#statusCode,
|
|
99
93
|
headers: this.#headers,
|
|
@@ -119,7 +113,6 @@ class Handler extends DecoratorHandler {
|
|
|
119
113
|
this.#timing.end = performance.now() - this.#created
|
|
120
114
|
|
|
121
115
|
const data = {
|
|
122
|
-
ureq: this.#opts,
|
|
123
116
|
ures: {
|
|
124
117
|
statusCode: this.#statusCode,
|
|
125
118
|
headers: this.#headers,
|