@holz/log-collector 0.8.3-rc.154 → 0.8.3-rc.155
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.
|
@@ -1,27 +1,37 @@
|
|
|
1
|
-
import { Log
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*/
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
import { Log } from '@holz/core';
|
|
2
|
+
import { LogProcessor } from '@holz/core';
|
|
3
|
+
|
|
4
|
+
declare interface Config {
|
|
5
|
+
fallback: LogProcessor;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Redirects logs to a global collector if one is configured. This is designed
|
|
10
|
+
* with apps in mind, which may want to aggregate logs from multiple sources.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createLogCollector: (config: Config) => LogProcessor;
|
|
13
|
+
|
|
14
|
+
declare interface InterceptorConfig {
|
|
15
|
+
/** Plugin handling all logs captured by the interceptor. */
|
|
16
|
+
processor: LogProcessor;
|
|
17
|
+
/**
|
|
18
|
+
* Only capture logs matching this function. Return `false` to use the
|
|
19
|
+
* default log destination. Defaults to capture all logs.
|
|
20
|
+
*/
|
|
21
|
+
condition?: (log: Log) => boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Overrides the default log destination for all loggers in the app. Call this
|
|
26
|
+
* early on startup. If logs are sent before registering the collector, they
|
|
27
|
+
* will be lost.
|
|
28
|
+
*/
|
|
29
|
+
export declare const setGlobalLogCollector: ({ processor, condition: match, }: InterceptorConfig) => void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Remove the global log collector restoring defaults. Safe to call regardless
|
|
33
|
+
* of whether one is set.
|
|
34
|
+
*/
|
|
35
|
+
export declare const unsetGlobalLogCollector: () => void;
|
|
36
|
+
|
|
37
|
+
export { }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holz/log-collector",
|
|
3
|
-
"version": "0.8.3-rc.
|
|
3
|
+
"version": "0.8.3-rc.155+ca9302f",
|
|
4
4
|
"description": "Send all logs to a central collector",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
"@holz/core": "^0.8.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@holz/core": "^0.8.3-rc.
|
|
42
|
+
"@holz/core": "^0.8.3-rc.155+ca9302f",
|
|
43
|
+
"@microsoft/api-extractor": "^7.58.8",
|
|
43
44
|
"@types/node": "^24.0.0",
|
|
44
45
|
"@vitest/coverage-v8": "^4.0.0",
|
|
45
46
|
"typescript": "^6.0.0",
|
|
@@ -48,5 +49,5 @@
|
|
|
48
49
|
"vite-tsconfig-paths": "^6.0.0",
|
|
49
50
|
"vitest": "^4.0.0"
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "ca9302f8b1709bb57058eb0dc73af0ed2021ddfd"
|
|
52
53
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { LogProcessor } from '@holz/core';
|
|
2
|
-
/**
|
|
3
|
-
* Redirects logs to a global collector if one is configured. This is designed
|
|
4
|
-
* with apps in mind, which may want to aggregate logs from multiple sources.
|
|
5
|
-
*/
|
|
6
|
-
export declare const createLogCollector: (config: Config) => LogProcessor;
|
|
7
|
-
export interface Config {
|
|
8
|
-
fallback: LogProcessor;
|
|
9
|
-
}
|