@platformatic/basic 2.59.0 → 2.60.0
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/base.js +4 -15
- package/package.json +6 -6
- package/schema.json +1 -1
package/lib/base.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { client, collectMetrics } from '@platformatic/metrics'
|
|
2
|
-
import { deepmerge, executeWithTimeout } from '@platformatic/utils'
|
|
2
|
+
import { deepmerge, executeWithTimeout, buildPinoOptions } from '@platformatic/utils'
|
|
3
3
|
import { parseCommandString } from 'execa'
|
|
4
4
|
import { spawn } from 'node:child_process'
|
|
5
5
|
import { once } from 'node:events'
|
|
6
6
|
import { existsSync } from 'node:fs'
|
|
7
|
-
import {
|
|
7
|
+
import { platform } from 'node:os'
|
|
8
8
|
import { pathToFileURL } from 'node:url'
|
|
9
9
|
import { workerData } from 'node:worker_threads'
|
|
10
10
|
import pino from 'pino'
|
|
@@ -48,19 +48,7 @@ export class BaseStackable {
|
|
|
48
48
|
this.stdout = standardStreams?.stdout ?? process.stdout
|
|
49
49
|
this.stderr = standardStreams?.stderr ?? process.stderr
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
const pinoOptions = {
|
|
53
|
-
level: this.configManager.current?.logger?.level ?? this.serverConfig?.logger?.level ?? 'trace'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
if (this.serviceId) {
|
|
57
|
-
pinoOptions.name = this.serviceId
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
if (typeof options.context.worker?.index !== 'undefined') {
|
|
61
|
-
pinoOptions.base = { pid: process.pid, hostname: hostname(), worker: this.workerId }
|
|
62
|
-
}
|
|
63
|
-
|
|
51
|
+
const pinoOptions = buildPinoOptions(this.configManager.current?.logger, this.serverConfig?.logger, this.serviceId, this.workerId, options, this.root)
|
|
64
52
|
this.logger = pino(pinoOptions, standardStreams?.stdout)
|
|
65
53
|
|
|
66
54
|
// Setup globals
|
|
@@ -164,6 +152,7 @@ export class BaseStackable {
|
|
|
164
152
|
|
|
165
153
|
registerGlobals (globals) {
|
|
166
154
|
globalThis.platformatic = Object.assign(globalThis.platformatic ?? {}, globals)
|
|
155
|
+
globalThis.platformatic.logger = this.logger
|
|
167
156
|
}
|
|
168
157
|
|
|
169
158
|
verifyOutputDirectory (path) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/basic",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.60.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"split2": "^4.2.0",
|
|
25
25
|
"undici": "^7.0.0",
|
|
26
26
|
"ws": "^8.18.0",
|
|
27
|
-
"@platformatic/
|
|
28
|
-
"@platformatic/
|
|
29
|
-
"@platformatic/
|
|
30
|
-
"@platformatic/
|
|
31
|
-
"@platformatic/utils": "2.
|
|
27
|
+
"@platformatic/config": "2.60.0",
|
|
28
|
+
"@platformatic/itc": "2.60.0",
|
|
29
|
+
"@platformatic/telemetry": "2.60.0",
|
|
30
|
+
"@platformatic/metrics": "2.60.0",
|
|
31
|
+
"@platformatic/utils": "2.60.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"borp": "^0.19.0",
|
package/schema.json
CHANGED