@nxtedition/lib 15.0.15 → 15.0.17
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/undici/utils.js +1 -1
- package/logger.js +7 -14
- package/package.json +4 -4
- package/serializers.js +4 -0
package/lib/undici/utils.js
CHANGED
package/logger.js
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
const serializers = require('./serializers')
|
|
2
2
|
const pino = require('pino')
|
|
3
|
-
const { isMainThread } = require('node:worker_threads')
|
|
4
3
|
|
|
5
4
|
const isProduction = process.env.NODE_ENV === 'production'
|
|
6
5
|
|
|
7
6
|
module.exports.createLogger = function (
|
|
8
|
-
{
|
|
9
|
-
extreme = isProduction,
|
|
10
|
-
level = isProduction ? 'debug' : 'trace',
|
|
11
|
-
flushInterval = 1e3,
|
|
12
|
-
stream = null,
|
|
13
|
-
...options
|
|
14
|
-
} = {},
|
|
7
|
+
{ level = isProduction ? 'debug' : 'trace', flushInterval = 1e3, stream = null, ...options } = {},
|
|
15
8
|
onTerminate,
|
|
16
9
|
) {
|
|
17
10
|
if (!stream) {
|
|
@@ -25,10 +18,8 @@ module.exports.createLogger = function (
|
|
|
25
18
|
|
|
26
19
|
if (stream) {
|
|
27
20
|
// Do nothing...
|
|
28
|
-
} else if (!
|
|
21
|
+
} else if (!isProduction) {
|
|
29
22
|
stream = pino.destination({ fd: process.stdout.fd ?? 1, sync: true })
|
|
30
|
-
} else if (!isMainThread) {
|
|
31
|
-
stream = pino.destination({ fd: 1, sync: false })
|
|
32
23
|
} else {
|
|
33
24
|
stream = pino.destination({ sync: false, minLength: 4096 })
|
|
34
25
|
setInterval(() => {
|
|
@@ -49,9 +40,11 @@ module.exports.createLogger = function (
|
|
|
49
40
|
)
|
|
50
41
|
|
|
51
42
|
function flush() {
|
|
52
|
-
stream
|
|
53
|
-
|
|
54
|
-
|
|
43
|
+
if (!stream.destroyed) {
|
|
44
|
+
stream?.end?.()
|
|
45
|
+
stream?.flush?.()
|
|
46
|
+
stream?.flushSync?.()
|
|
47
|
+
}
|
|
55
48
|
}
|
|
56
49
|
|
|
57
50
|
let called = false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nxtedition/lib",
|
|
3
|
-
"version": "15.0.
|
|
3
|
+
"version": "15.0.17",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Robert Nagy <robert.nagy@boffins.se>",
|
|
6
6
|
"files": [
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"smpte-timecode": "^1.3.3",
|
|
95
95
|
"split-string": "^6.0.0",
|
|
96
96
|
"toobusy-js": "^0.5.1",
|
|
97
|
-
"undici": "^5.25.
|
|
97
|
+
"undici": "^5.25.4",
|
|
98
98
|
"url-join": "^4.0.0",
|
|
99
99
|
"xuid": "^4.1.2"
|
|
100
100
|
},
|
|
101
101
|
"devDependencies": {
|
|
102
|
-
"@types/node": "^20.
|
|
102
|
+
"@types/node": "^20.8.2",
|
|
103
103
|
"eslint": "^8.50.0",
|
|
104
104
|
"eslint-config-prettier": "^9.0.0",
|
|
105
105
|
"eslint-config-standard": "^17.0.0",
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"prettier": "^3.0.3",
|
|
114
114
|
"rxjs": "^7.5.6",
|
|
115
115
|
"send": "^0.18.0",
|
|
116
|
-
"tap": "^18.
|
|
116
|
+
"tap": "^18.4.2"
|
|
117
117
|
},
|
|
118
118
|
"peerDependencies": {
|
|
119
119
|
"@elastic/elasticsearch": "^8.6.0",
|