@kubun/logger 0.12.0 → 0.13.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/index.js +10 -1
- package/package.json +5 -2
package/lib/index.js
CHANGED
|
@@ -7,6 +7,14 @@ export function getKubunLogger(namespace, properties) {
|
|
|
7
7
|
}
|
|
8
8
|
export function getDefaultConfig(options) {
|
|
9
9
|
const config = getEnkakuConfig(options);
|
|
10
|
+
// Names the same 'console' sink as the root entry this sits beside, so it MUST override rather
|
|
11
|
+
// than inherit: logtape's default 'inherit' unions a category's sinks with its parent's without
|
|
12
|
+
// de-duplicating by identity, which printed every kubun error twice through the one sink object.
|
|
13
|
+
//
|
|
14
|
+
// The entry itself is not redundant with the root. It exists so an app can lower the kubun
|
|
15
|
+
// category on its own — `getDefaultConfig().loggers` is walked and mutated for exactly that
|
|
16
|
+
// (see apps/local-todo) — and with 'override' the lowered level now reaches the console
|
|
17
|
+
// instead of being clipped back to the root's floor.
|
|
10
18
|
config.loggers.push({
|
|
11
19
|
category: [
|
|
12
20
|
'kubun'
|
|
@@ -14,7 +22,8 @@ export function getDefaultConfig(options) {
|
|
|
14
22
|
lowestLevel: 'error',
|
|
15
23
|
sinks: [
|
|
16
24
|
'console'
|
|
17
|
-
]
|
|
25
|
+
],
|
|
26
|
+
parentSinks: 'override'
|
|
18
27
|
});
|
|
19
28
|
return config;
|
|
20
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubun/logger",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"license": "see LICENSE.md",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,7 +15,10 @@
|
|
|
15
15
|
"LICENSE.md"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@sozai/log": "^0.3.
|
|
18
|
+
"@sozai/log": "^0.3.1"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public"
|
|
19
22
|
},
|
|
20
23
|
"scripts": {
|
|
21
24
|
"build": "pnpm run build:clean && pnpm run build:js && pnpm run build:types",
|