@holz/core 0.11.1-rc.1.sha-3cddd8c → 0.11.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/{functions--NrapiiE.js → functions-BVJ92FOx.js} +2 -1
- package/dist/functions.d.ts +1 -1
- package/dist/functions.js +1 -1
- package/dist/holz-core.d.ts +1 -1
- package/dist/holz-core.js +1 -1
- package/dist/{index-BUa0qbx8.d.ts → index-BCJez7yY.d.ts} +2 -2
- package/package.json +2 -2
- package/src/functions/batcher.ts +5 -2
package/dist/functions.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createRouter, c as LogBuffer, d as LogBatcher, f as LogBatcherOptions, i as LogRouter, l as LogBufferOptions, n as LogValveOptions, o as createGroup, p as createBatcher, r as createValve, s as createFilter, t as LogValve, u as createBuffer } from "./index-
|
|
1
|
+
import { a as createRouter, c as LogBuffer, d as LogBatcher, f as LogBatcherOptions, i as LogRouter, l as LogBufferOptions, n as LogValveOptions, o as createGroup, p as createBatcher, r as createValve, s as createFilter, t as LogValve, u as createBuffer } from "./index-BCJez7yY.js";
|
|
2
2
|
export { type LogBatcher, type LogBatcherOptions, type LogBuffer, type LogBufferOptions, type LogRouter, type LogValve, type LogValveOptions, createBatcher, createBuffer, createFilter, createGroup, createRouter, createValve };
|
package/dist/functions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { o as createBatcher, a as createBuffer, i as createFilter, r as createGroup, n as createRouter, t as createValve } from "./functions
|
|
1
|
+
export { o as createBatcher, a as createBuffer, i as createFilter, r as createGroup, n as createRouter, t as createValve } from "./functions-BVJ92FOx.js";
|
package/dist/holz-core.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as LogLevel, b as level, g as LogContext, h as Log, m as CustomContext, o as createGroup, s as createFilter, v as LogProcessor, y as Logger } from "./index-
|
|
1
|
+
import { _ as LogLevel, b as level, g as LogContext, h as Log, m as CustomContext, o as createGroup, s as createFilter, v as LogProcessor, y as Logger } from "./index-BCJez7yY.js";
|
|
2
2
|
/**
|
|
3
3
|
* Create a new logger. The processor is up to you. There are plugins for
|
|
4
4
|
* filtering, formatting, combining multiple processors together, and more.
|
package/dist/holz-core.js
CHANGED
|
@@ -124,8 +124,8 @@ interface LogBatcher {
|
|
|
124
124
|
processor: LogProcessor;
|
|
125
125
|
/** Flush the pending batch to the sink early. No-op when empty. */
|
|
126
126
|
drain: () => void;
|
|
127
|
-
/** Discard the pending batch without flushing it. */
|
|
128
|
-
clear: () =>
|
|
127
|
+
/** Discard the pending batch without flushing it and return its logs. */
|
|
128
|
+
clear: () => Log[];
|
|
129
129
|
}
|
|
130
130
|
/** Options for {@link createBatcher}. */
|
|
131
131
|
interface LogBatcherOptions {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holz/core",
|
|
3
|
-
"version": "0.11.1
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "A structured and composable logger",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"vite": "^8.0.0",
|
|
51
51
|
"vitest": "^5.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "403cdd1fde8ddae0c849fac0df50d7b6e2f5ed4a"
|
|
54
54
|
}
|
package/src/functions/batcher.ts
CHANGED
|
@@ -12,8 +12,8 @@ export interface LogBatcher {
|
|
|
12
12
|
/** Flush the pending batch to the sink early. No-op when empty. */
|
|
13
13
|
drain: () => void;
|
|
14
14
|
|
|
15
|
-
/** Discard the pending batch without flushing it. */
|
|
16
|
-
clear: () =>
|
|
15
|
+
/** Discard the pending batch without flushing it and return its logs. */
|
|
16
|
+
clear: () => Log[];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/** Options for {@link createBatcher}. */
|
|
@@ -54,7 +54,10 @@ export const createBatcher = ({
|
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
const clear = () => {
|
|
57
|
+
const discarded = pending;
|
|
57
58
|
pending = [];
|
|
59
|
+
|
|
60
|
+
return discarded;
|
|
58
61
|
};
|
|
59
62
|
|
|
60
63
|
return { processor, drain, clear };
|