@yadsh/dsh-plugin-log 0.2.0 → 0.2.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/lib/host-logger.d.ts +9 -1
- package/lib/host-logger.d.ts.map +1 -1
- package/lib/host-logger.js +2 -2
- package/lib/host-logger.js.map +1 -1
- package/package.json +4 -3
package/lib/host-logger.d.ts
CHANGED
|
@@ -6,10 +6,18 @@ export interface HostLoggerLike {
|
|
|
6
6
|
error(message: string, ...values: unknown[]): unknown;
|
|
7
7
|
debug?(message: string, ...values: unknown[]): unknown;
|
|
8
8
|
}
|
|
9
|
+
export interface HostLoggerSinkOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Mirror `trace`/`debug` records through `host.info` even when the host
|
|
12
|
+
* exposes `debug`. Use this only when the mirror previously behaved that
|
|
13
|
+
* way and callers depend on verbose records staying visible.
|
|
14
|
+
*/
|
|
15
|
+
readonly verboseToInfo?: boolean;
|
|
16
|
+
}
|
|
9
17
|
/**
|
|
10
18
|
* Adapt a DSH/Cordis context logger to the shared plugin logger's console
|
|
11
19
|
* mirror. Trace falls back to debug, debug falls back to info, and fatal is
|
|
12
20
|
* routed through error because the host exposes four severity methods.
|
|
13
21
|
*/
|
|
14
|
-
export declare function createHostLoggerSink(host: HostLoggerLike): PluginConsoleSink;
|
|
22
|
+
export declare function createHostLoggerSink(host: HostLoggerLike, options?: HostLoggerSinkOptions): PluginConsoleSink;
|
|
15
23
|
//# sourceMappingURL=host-logger.d.ts.map
|
package/lib/host-logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-logger.d.ts","sourceRoot":"","sources":["../src/host-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACtD,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CACxD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"host-logger.d.ts","sourceRoot":"","sources":["../src/host-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE1E,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACrD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;IACtD,KAAK,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC;CACxD;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,cAAc,EACpB,OAAO,GAAE,qBAA0B,GAClC,iBAAiB,CAanB"}
|
package/lib/host-logger.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* mirror. Trace falls back to debug, debug falls back to info, and fatal is
|
|
4
4
|
* routed through error because the host exposes four severity methods.
|
|
5
5
|
*/
|
|
6
|
-
export function createHostLoggerSink(host) {
|
|
6
|
+
export function createHostLoggerSink(host, options = {}) {
|
|
7
7
|
return (level, message) => {
|
|
8
8
|
if (level === "trace" || level === "debug") {
|
|
9
|
-
if (typeof host.debug === "function")
|
|
9
|
+
if (options.verboseToInfo !== true && typeof host.debug === "function")
|
|
10
10
|
host.debug(message);
|
|
11
11
|
else
|
|
12
12
|
host.info(message);
|
package/lib/host-logger.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-logger.js","sourceRoot":"","sources":["../src/host-logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"host-logger.js","sourceRoot":"","sources":["../src/host-logger.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAAoB,EACpB,UAAiC,EAAE;IAEnC,OAAO,CAAC,KAAmB,EAAE,OAAe,EAAQ,EAAE;QACpD,IAAI,KAAK,KAAK,OAAO,IAAI,KAAK,KAAK,OAAO,EAAE,CAAC;YAC3C,IAAI,OAAO,CAAC,aAAa,KAAK,IAAI,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU;gBAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;;gBACvF,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;aAAM,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;aAAM,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;YAC5B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yadsh/dsh-plugin-log",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Shared structured file logging and runtime logger discovery for DSH plugins",
|
|
5
5
|
"homepage": "https://github.com/xarleyn/dsh-plugins/tree/main/packages/plugin-log#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"eslint": "10.9.1",
|
|
36
36
|
"typescript": "^5.9.2",
|
|
37
37
|
"vitest": "^4.1.11",
|
|
38
|
-
"@yadsh/dsh-config": "^0.0.0"
|
|
38
|
+
"@yadsh/dsh-config": "^0.0.0",
|
|
39
|
+
"@yadsh/dsh-test-kit": "^0.1.0"
|
|
39
40
|
},
|
|
40
41
|
"publishConfig": {
|
|
41
42
|
"access": "public",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"node": ">=20"
|
|
46
47
|
},
|
|
47
48
|
"scripts": {
|
|
48
|
-
"build": "tsc",
|
|
49
|
+
"build": "tsc -p tsconfig.build.json",
|
|
49
50
|
"lint": "eslint src tests",
|
|
50
51
|
"test": "vitest run",
|
|
51
52
|
"typecheck": "tsc --noEmit",
|