logroller 2.1.0 → 3.0.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/README.md +406 -382
- package/dist/index.cjs +2 -1336
- package/dist/{shutdown.d.ts → index.d.cts} +13 -6
- package/dist/index.d.ts +36 -6
- package/dist/index.esm.js +2 -1331
- package/dist/pino.cjs +2 -0
- package/dist/pino.d.cts +6 -0
- package/dist/pino.d.ts +6 -0
- package/dist/pino.esm.js +2 -0
- package/dist/rotate-file-stream.cjs +2 -0
- package/dist/rotate-file-stream.d.cts +350 -0
- package/dist/rotate-file-stream.d.ts +198 -7
- package/dist/rotate-file-stream.esm.js +2 -0
- package/package.json +27 -10
- package/CHANGELOG.md +0 -151
- package/dist/fsio.d.ts +0 -11
- package/dist/parsers.d.ts +0 -18
- package/dist/time.d.ts +0 -13
- package/dist/types.d.ts +0 -159
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import { R as RotateFileStream } from './rotate-file-stream.cjs';
|
|
2
|
+
export { C as ClockInfo, a as RotateFileStreamEventMap, b as RotateFileStreamOptions, c as RotatedInfo, d as RotationReason, S as SealInfo, e as SegmentInfo, f as StreamStats, g as createStream } from './rotate-file-stream.cjs';
|
|
3
|
+
import 'node:stream';
|
|
4
|
+
|
|
5
|
+
interface ShutdownOptions {
|
|
3
6
|
/** Signals to listen on. @default ["SIGINT", "SIGTERM"] */
|
|
4
7
|
signals?: NodeJS.Signals[];
|
|
5
8
|
/** Hard-exit deadline (ms) if a stream refuses to end.
|
|
@@ -23,10 +26,14 @@ export interface ShutdownOptions {
|
|
|
23
26
|
* const flush = installShutdown(logStream);
|
|
24
27
|
* process.on("exit", () => { void flush(); });
|
|
25
28
|
*/
|
|
26
|
-
|
|
29
|
+
declare function installShutdown(streams: RotateFileStream | RotateFileStream[], opts?: ShutdownOptions): () => Promise<void>;
|
|
27
30
|
/**
|
|
28
31
|
* End every registered stream (flush buffered writes) with a deadline.
|
|
29
|
-
* Does NOT exit the process.
|
|
30
|
-
*
|
|
32
|
+
* Does NOT exit the process. Resolves `true` when every stream finished,
|
|
33
|
+
* `false` when the deadline hit first. Concurrent calls share one flush.
|
|
34
|
+
* Ended/destroyed streams leave the registry.
|
|
31
35
|
*/
|
|
32
|
-
|
|
36
|
+
declare function flushAll(timeoutMs?: number): Promise<boolean>;
|
|
37
|
+
|
|
38
|
+
export { RotateFileStream, flushAll, installShutdown };
|
|
39
|
+
export type { ShutdownOptions };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,39 @@
|
|
|
1
|
+
import { R as RotateFileStream } from './rotate-file-stream.js';
|
|
2
|
+
export { C as ClockInfo, a as RotateFileStreamEventMap, b as RotateFileStreamOptions, c as RotatedInfo, d as RotationReason, S as SealInfo, e as SegmentInfo, f as StreamStats, g as createStream } from './rotate-file-stream.js';
|
|
3
|
+
import 'node:stream';
|
|
4
|
+
|
|
5
|
+
interface ShutdownOptions {
|
|
6
|
+
/** Signals to listen on. @default ["SIGINT", "SIGTERM"] */
|
|
7
|
+
signals?: NodeJS.Signals[];
|
|
8
|
+
/** Hard-exit deadline (ms) if a stream refuses to end.
|
|
9
|
+
* @default 5000 */
|
|
10
|
+
timeoutMs?: number;
|
|
11
|
+
/** Process exit code. @default 0 */
|
|
12
|
+
code?: number;
|
|
13
|
+
}
|
|
1
14
|
/**
|
|
2
|
-
*
|
|
15
|
+
* Register streams for graceful shutdown: on SIGINT/SIGTERM every
|
|
16
|
+
* registered stream is ended — flushing buffered writes and finishing the
|
|
17
|
+
* audit manifest — before the process exits, with a hard deadline.
|
|
3
18
|
*
|
|
4
|
-
*
|
|
19
|
+
* Safe to call multiple times: process listeners install once, streams
|
|
20
|
+
* accumulate in the registry.
|
|
21
|
+
*
|
|
22
|
+
* Returns `flush()`, the same graceful end WITHOUT exiting — for tests
|
|
23
|
+
* and custom signal handling.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* const flush = installShutdown(logStream);
|
|
27
|
+
* process.on("exit", () => { void flush(); });
|
|
28
|
+
*/
|
|
29
|
+
declare function installShutdown(streams: RotateFileStream | RotateFileStream[], opts?: ShutdownOptions): () => Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* End every registered stream (flush buffered writes) with a deadline.
|
|
32
|
+
* Does NOT exit the process. Resolves `true` when every stream finished,
|
|
33
|
+
* `false` when the deadline hit first. Concurrent calls share one flush.
|
|
34
|
+
* Ended/destroyed streams leave the registry.
|
|
5
35
|
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export
|
|
9
|
-
export type {
|
|
36
|
+
declare function flushAll(timeoutMs?: number): Promise<boolean>;
|
|
37
|
+
|
|
38
|
+
export { RotateFileStream, flushAll, installShutdown };
|
|
39
|
+
export type { ShutdownOptions };
|