@nxtedition/lib 15.0.7 → 15.0.8

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.
Files changed (2) hide show
  1. package/logger.js +6 -6
  2. package/package.json +1 -1
package/logger.js CHANGED
@@ -12,14 +12,12 @@ module.exports.createLogger = function (
12
12
  stream = null,
13
13
  ...options
14
14
  } = {},
15
- onTerminate
15
+ onTerminate,
16
16
  ) {
17
17
  if (!stream) {
18
- if (!isMainThread) {
19
- stream = pino.destination({ fd: 1, sync: true })
20
- } else if (
18
+ if (
21
19
  process.stdout.write !== process.stdout.constructor.prototype.write ||
22
- !process.stdout.fd
20
+ process.stdout.fd == null
23
21
  ) {
24
22
  stream = process.stdout
25
23
  }
@@ -29,6 +27,8 @@ module.exports.createLogger = function (
29
27
  // Do nothing...
30
28
  } else if (!extreme) {
31
29
  stream = pino.destination({ fd: process.stdout.fd ?? 1, sync: true })
30
+ } else if (!isMainThread) {
31
+ stream = pino.destination({ fd: 1, sync: false })
32
32
  } else {
33
33
  stream = pino.destination({ fd: process.stdout.fd ?? 1, sync: false, minLength: 4096 })
34
34
  setInterval(() => {
@@ -45,7 +45,7 @@ module.exports.createLogger = function (
45
45
  ...options.serializers,
46
46
  },
47
47
  },
48
- stream
48
+ stream,
49
49
  )
50
50
 
51
51
  let called = false
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxtedition/lib",
3
- "version": "15.0.7",
3
+ "version": "15.0.8",
4
4
  "license": "MIT",
5
5
  "author": "Robert Nagy <robert.nagy@boffins.se>",
6
6
  "files": [