@codefresh-io/cf-telemetry 3.8.0 → 3.8.1
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/dist/logs/logger.js +22 -22
- package/dist/logs/logger.js.map +1 -1
- package/package.json +1 -1
package/dist/logs/logger.js
CHANGED
|
@@ -8,34 +8,34 @@ const pino_1 = __importDefault(require("pino"));
|
|
|
8
8
|
const config_1 = require("./config");
|
|
9
9
|
const metadata_storage_1 = require("./metadata-storage");
|
|
10
10
|
exports.pinoDestination = pino_1.default.destination({ sync: config_1.config.sync });
|
|
11
|
+
const pinoInstance = (0, pino_1.default)({
|
|
12
|
+
level: config_1.config.level,
|
|
13
|
+
/**
|
|
14
|
+
* Set to `undefined` to disable default pino metadata.
|
|
15
|
+
* Docs: https://github.com/pinojs/pino/blob/main/docs/api.md#base-object
|
|
16
|
+
*/
|
|
17
|
+
base: undefined,
|
|
18
|
+
formatters: {
|
|
19
|
+
level: label => ({ level: label }),
|
|
20
|
+
},
|
|
21
|
+
...config_1.config.prettify && {
|
|
22
|
+
transport: {
|
|
23
|
+
target: 'pino-pretty',
|
|
24
|
+
options: {
|
|
25
|
+
colorize: true,
|
|
26
|
+
singleLine: config_1.config.prettify === 'single-line',
|
|
27
|
+
translateTime: config_1.config.prettifyTimeFormat,
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
}, exports.pinoDestination);
|
|
11
32
|
class Logger {
|
|
12
33
|
#options;
|
|
13
34
|
#baseLogger;
|
|
14
35
|
#defaultInitiator = config_1.config.defaultInitiator;
|
|
15
36
|
constructor(options = {}) {
|
|
16
37
|
this.#options = typeof options === 'string' ? { scope: options } : options;
|
|
17
|
-
this.#baseLogger = (
|
|
18
|
-
level: config_1.config.level,
|
|
19
|
-
/**
|
|
20
|
-
* Set to `undefined` to disable default pino metadata.
|
|
21
|
-
* Docs: https://github.com/pinojs/pino/blob/main/docs/api.md#base-object
|
|
22
|
-
*/
|
|
23
|
-
base: undefined,
|
|
24
|
-
formatters: {
|
|
25
|
-
level: label => ({ level: label }),
|
|
26
|
-
},
|
|
27
|
-
...config_1.config.prettify && {
|
|
28
|
-
name: this.#options.scope,
|
|
29
|
-
transport: {
|
|
30
|
-
target: 'pino-pretty',
|
|
31
|
-
options: {
|
|
32
|
-
colorize: true,
|
|
33
|
-
singleLine: config_1.config.prettify === 'single-line',
|
|
34
|
-
translateTime: config_1.config.prettifyTimeFormat,
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
}, exports.pinoDestination);
|
|
38
|
+
this.#baseLogger = pinoInstance.child({ name: this.#options.scope });
|
|
39
39
|
}
|
|
40
40
|
#getChildScope(childScope) {
|
|
41
41
|
return this.#options.scope
|
package/dist/logs/logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logs/logger.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,qCAAkC;AAClC,yDAAqD;AAUxC,QAAA,eAAe,GAAG,cAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,eAAM,CAAC,IAAI,EAAE,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logs/logger.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,qCAAkC;AAClC,yDAAqD;AAUxC,QAAA,eAAe,GAAG,cAAI,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,eAAM,CAAC,IAAI,EAAE,CAAC,CAAC;AACvE,MAAM,YAAY,GAAG,IAAA,cAAI,EACvB;IACE,KAAK,EAAE,eAAM,CAAC,KAAK;IACnB;;;OAGG;IACH,IAAI,EAAE,SAAS;IACf,UAAU,EAAE;QACV,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;KACnC;IACD,GAAG,eAAM,CAAC,QAA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