@decohere/scribe-pino 0.0.1-dev.119 → 0.0.1-dev.120
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.
|
@@ -194,13 +194,18 @@ function logMethod(args, method) {
|
|
|
194
194
|
}
|
|
195
195
|
method.call(this, message);
|
|
196
196
|
}
|
|
197
|
-
|
|
197
|
+
/**
|
|
198
|
+
* Add Scribe's logger members to a Pino logger. `spawn` is Pino's own `child`:
|
|
199
|
+
* a Pino child inherits its parent's members through the prototype, so
|
|
200
|
+
* `logger.child` would be the parent's override.
|
|
201
|
+
*/ function pinoMix(logger, spawn = logger.child) {
|
|
198
202
|
return Object.assign(logger, {
|
|
199
203
|
get currentLevel () {
|
|
200
204
|
return logger.level;
|
|
201
205
|
},
|
|
202
206
|
get logLevels () {
|
|
203
207
|
return logger.levels.values;
|
|
204
|
-
}
|
|
208
|
+
},
|
|
209
|
+
child: (fields)=>pinoMix(spawn.call(logger, fields), spawn)
|
|
205
210
|
});
|
|
206
211
|
}
|
package/es6/src/pino.adapater.js
CHANGED
|
@@ -179,13 +179,18 @@ function logMethod(args, method) {
|
|
|
179
179
|
}
|
|
180
180
|
method.call(this, message);
|
|
181
181
|
}
|
|
182
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Add Scribe's logger members to a Pino logger. `spawn` is Pino's own `child`:
|
|
184
|
+
* a Pino child inherits its parent's members through the prototype, so
|
|
185
|
+
* `logger.child` would be the parent's override.
|
|
186
|
+
*/ function pinoMix(logger, spawn = logger.child) {
|
|
183
187
|
return Object.assign(logger, {
|
|
184
188
|
get currentLevel () {
|
|
185
189
|
return logger.level;
|
|
186
190
|
},
|
|
187
191
|
get logLevels () {
|
|
188
192
|
return logger.levels.values;
|
|
189
|
-
}
|
|
193
|
+
},
|
|
194
|
+
child: (fields)=>pinoMix(spawn.call(logger, fields), spawn)
|
|
190
195
|
});
|
|
191
196
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decohere/scribe-pino",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.120",
|
|
4
4
|
"description": "Pino adapter for @decohere/scribe",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@decohere/core": "0.0.1-dev.
|
|
27
|
-
"@decohere/scribe": "0.0.1-dev.
|
|
26
|
+
"@decohere/core": "0.0.1-dev.120",
|
|
27
|
+
"@decohere/scribe": "0.0.1-dev.120",
|
|
28
28
|
"pino": "^10.3.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {},
|