prismcast 1.13.0 → 1.14.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/dist/app.d.ts +88 -6
- package/dist/app.js +287 -154
- package/dist/app.js.map +1 -1
- package/dist/browser/cdp.d.ts +6 -17
- package/dist/browser/cdp.js +6 -57
- package/dist/browser/cdp.js.map +1 -1
- package/dist/browser/index.d.ts +106 -23
- package/dist/browser/index.js +292 -225
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/precaching.d.ts +25 -11
- package/dist/browser/precaching.js +245 -97
- package/dist/browser/precaching.js.map +1 -1
- package/dist/browser/tabCapture.js +3 -10
- package/dist/browser/tabCapture.js.map +1 -1
- package/dist/browser/tuning/comcastPolymer.js +13 -14
- package/dist/browser/tuning/comcastPolymer.js.map +1 -1
- package/dist/browser/tuning/hbo.js +34 -17
- package/dist/browser/tuning/hbo.js.map +1 -1
- package/dist/browser/video.d.ts +1 -1
- package/dist/browser/video.js +3 -3
- package/dist/channels/index.js +5 -5
- package/dist/channels/index.js.map +1 -1
- package/dist/cliHelp.d.ts +11 -0
- package/dist/cliHelp.js +148 -0
- package/dist/cliHelp.js.map +1 -0
- package/dist/config/channelForm.js +5 -4
- package/dist/config/channelForm.js.map +1 -1
- package/dist/config/consistencyProbe.d.ts +2 -4
- package/dist/config/consistencyProbe.js +8 -51
- package/dist/config/consistencyProbe.js.map +1 -1
- package/dist/config/index.d.ts +107 -55
- package/dist/config/index.js +499 -267
- package/dist/config/index.js.map +1 -1
- package/dist/config/paths.d.ts +13 -8
- package/dist/config/paths.js +21 -25
- package/dist/config/paths.js.map +1 -1
- package/dist/config/persistence.d.ts +57 -11
- package/dist/config/persistence.js +127 -44
- package/dist/config/persistence.js.map +1 -1
- package/dist/config/reactivity.d.ts +60 -36
- package/dist/config/reactivity.js +89 -116
- package/dist/config/reactivity.js.map +1 -1
- package/dist/config/services.d.ts +61 -26
- package/dist/config/services.js +137 -68
- package/dist/config/services.js.map +1 -1
- package/dist/config/streamSettings.d.ts +24 -0
- package/dist/config/streamSettings.js +17 -0
- package/dist/config/streamSettings.js.map +1 -0
- package/dist/config/userChannels.d.ts +60 -52
- package/dist/config/userChannels.js +138 -188
- package/dist/config/userChannels.js.map +1 -1
- package/dist/config/userConfig.d.ts +224 -61
- package/dist/config/userConfig.js +351 -134
- package/dist/config/userConfig.js.map +1 -1
- package/dist/hdhr/discover.d.ts +7 -1
- package/dist/hdhr/discover.js +12 -6
- package/dist/hdhr/discover.js.map +1 -1
- package/dist/hdhr/index.d.ts +51 -10
- package/dist/hdhr/index.js +108 -112
- package/dist/hdhr/index.js.map +1 -1
- package/dist/hdhr/udp.d.ts +11 -4
- package/dist/hdhr/udp.js +25 -20
- package/dist/hdhr/udp.js.map +1 -1
- package/dist/index.js +16 -143
- package/dist/index.js.map +1 -1
- package/dist/native/index.d.ts +1 -1
- package/dist/native/index.js +4 -3
- package/dist/native/index.js.map +1 -1
- package/dist/native/proxy.d.ts +1 -1
- package/dist/native/proxy.js +36 -28
- package/dist/native/proxy.js.map +1 -1
- package/dist/routes/cdp.d.ts +7 -6
- package/dist/routes/cdp.js +9 -8
- package/dist/routes/cdp.js.map +1 -1
- package/dist/routes/components.d.ts +23 -5
- package/dist/routes/components.js +21 -4
- package/dist/routes/components.js.map +1 -1
- package/dist/routes/config/channels/endpoints/browse.js +39 -29
- package/dist/routes/config/channels/endpoints/browse.js.map +1 -1
- package/dist/routes/config/channels/endpoints/bulk.js +2 -6
- package/dist/routes/config/channels/endpoints/bulk.js.map +1 -1
- package/dist/routes/config/channels/endpoints/predefined.js +5 -15
- package/dist/routes/config/channels/endpoints/predefined.js.map +1 -1
- package/dist/routes/config/channels/endpoints/prefs.js +7 -6
- package/dist/routes/config/channels/endpoints/prefs.js.map +1 -1
- package/dist/routes/config/channels/endpoints/service.js +6 -5
- package/dist/routes/config/channels/endpoints/service.js.map +1 -1
- package/dist/routes/config/channels/endpoints/tags.js +4 -16
- package/dist/routes/config/channels/endpoints/tags.js.map +1 -1
- package/dist/routes/config/channels/table.d.ts +2 -1
- package/dist/routes/config/channels/table.js +11 -13
- package/dist/routes/config/channels/table.js.map +1 -1
- package/dist/routes/config/http/envelope.d.ts +6 -3
- package/dist/routes/config/http/envelope.js +18 -5
- package/dist/routes/config/http/envelope.js.map +1 -1
- package/dist/routes/config/index.d.ts +21 -13
- package/dist/routes/config/index.js +47 -34
- package/dist/routes/config/index.js.map +1 -1
- package/dist/routes/config/settings.d.ts +43 -6
- package/dist/routes/config/settings.js +225 -125
- package/dist/routes/config/settings.js.map +1 -1
- package/dist/routes/config/vocabulary.d.ts +24 -0
- package/dist/routes/config/vocabulary.js +33 -0
- package/dist/routes/config/vocabulary.js.map +1 -0
- package/dist/routes/debug.js +28 -13
- package/dist/routes/debug.js.map +1 -1
- package/dist/routes/root/content.js +33 -26
- package/dist/routes/root/content.js.map +1 -1
- package/dist/routes/root/scripts/channels.js +23 -11
- package/dist/routes/root/scripts/channels.js.map +1 -1
- package/dist/routes/root/scripts/config.d.ts +1 -1
- package/dist/routes/root/scripts/config.js +127 -79
- package/dist/routes/root/scripts/config.js.map +1 -1
- package/dist/routes/root/scripts/shared.js +34 -23
- package/dist/routes/root/scripts/shared.js.map +1 -1
- package/dist/routes/root/scripts/status.handlers.d.ts +8 -13
- package/dist/routes/root/scripts/status.handlers.js +35 -21
- package/dist/routes/root/scripts/status.handlers.js.map +1 -1
- package/dist/routes/root/styles.js +13 -16
- package/dist/routes/root/styles.js.map +1 -1
- package/dist/routes/services.js +12 -16
- package/dist/routes/services.js.map +1 -1
- package/dist/routes/theme.js +12 -12
- package/dist/routes/theme.js.map +1 -1
- package/dist/routes/ui.d.ts +4 -3
- package/dist/routes/ui.js +17 -13
- package/dist/routes/ui.js.map +1 -1
- package/dist/service/generators.js +12 -9
- package/dist/service/generators.js.map +1 -1
- package/dist/streaming/captureSession.d.ts +4 -4
- package/dist/streaming/captureSession.js +6 -7
- package/dist/streaming/captureSession.js.map +1 -1
- package/dist/streaming/codec.d.ts +12 -2
- package/dist/streaming/codec.js +40 -28
- package/dist/streaming/codec.js.map +1 -1
- package/dist/streaming/fmp4Segmenter.d.ts +14 -4
- package/dist/streaming/fmp4Segmenter.js +99 -79
- package/dist/streaming/fmp4Segmenter.js.map +1 -1
- package/dist/streaming/hls.d.ts +21 -14
- package/dist/streaming/hls.js +148 -122
- package/dist/streaming/hls.js.map +1 -1
- package/dist/streaming/hlsResume.d.ts +36 -13
- package/dist/streaming/hlsResume.js +68 -37
- package/dist/streaming/hlsResume.js.map +1 -1
- package/dist/streaming/monitor.d.ts +5 -3
- package/dist/streaming/monitor.js +47 -37
- package/dist/streaming/monitor.js.map +1 -1
- package/dist/streaming/mp4Parser.d.ts +29 -4
- package/dist/streaming/mp4Parser.js +49 -7
- package/dist/streaming/mp4Parser.js.map +1 -1
- package/dist/streaming/playlistBuilder.d.ts +1 -2
- package/dist/streaming/playlistBuilder.js +2 -3
- package/dist/streaming/playlistBuilder.js.map +1 -1
- package/dist/streaming/preroll.d.ts +43 -16
- package/dist/streaming/preroll.js +112 -62
- package/dist/streaming/preroll.js.map +1 -1
- package/dist/streaming/pretune.d.ts +2 -2
- package/dist/streaming/pretune.js +11 -7
- package/dist/streaming/pretune.js.map +1 -1
- package/dist/streaming/recovery.d.ts +29 -2
- package/dist/streaming/recovery.js +43 -4
- package/dist/streaming/recovery.js.map +1 -1
- package/dist/streaming/registry.d.ts +13 -10
- package/dist/streaming/registry.js +6 -5
- package/dist/streaming/registry.js.map +1 -1
- package/dist/streaming/setup.d.ts +29 -20
- package/dist/streaming/setup.js +181 -170
- package/dist/streaming/setup.js.map +1 -1
- package/dist/streaming/showInfo.d.ts +24 -12
- package/dist/streaming/showInfo.js +120 -113
- package/dist/streaming/showInfo.js.map +1 -1
- package/dist/streaming/statusEmitter.d.ts +15 -10
- package/dist/streaming/statusEmitter.js +24 -20
- package/dist/streaming/statusEmitter.js.map +1 -1
- package/dist/types/config.d.ts +24 -13
- package/dist/types/config.js +5 -1
- package/dist/types/config.js.map +1 -1
- package/dist/types/index.d.ts +3 -2
- package/dist/types/index.js +2 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/profiles.d.ts +2 -2
- package/dist/types/selection.d.ts +12 -10
- package/dist/types/streaming.d.ts +12 -5
- package/dist/types/streaming.js +12 -5
- package/dist/types/streaming.js.map +1 -1
- package/dist/utils/debugFilter.d.ts +3 -2
- package/dist/utils/debugFilter.js +7 -5
- package/dist/utils/debugFilter.js.map +1 -1
- package/dist/{hdhr → utils}/deviceId.d.ts +1 -1
- package/dist/{hdhr → utils}/deviceId.js +11 -29
- package/dist/utils/deviceId.js.map +1 -0
- package/dist/utils/errors.d.ts +7 -0
- package/dist/utils/errors.js +12 -3
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/fileLogger.d.ts +23 -12
- package/dist/utils/fileLogger.js +73 -41
- package/dist/utils/fileLogger.js.map +1 -1
- package/dist/utils/httpErrors.d.ts +13 -0
- package/dist/utils/httpErrors.js +22 -0
- package/dist/utils/httpErrors.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/logger.d.ts +9 -8
- package/dist/utils/logger.js +64 -20
- package/dist/utils/logger.js.map +1 -1
- package/dist/utils/markup.js +8 -3
- package/dist/utils/markup.js.map +1 -1
- package/dist/utils/plainObject.d.ts +6 -0
- package/dist/utils/plainObject.js +18 -0
- package/dist/utils/plainObject.js.map +1 -0
- package/dist/utils/runtimeIdentity.context.js +1 -29
- package/dist/utils/runtimeIdentity.context.js.map +1 -1
- package/dist/utils/runtimeIdentity.d.ts +17 -6
- package/dist/utils/runtimeIdentity.js +50 -17
- package/dist/utils/runtimeIdentity.js.map +1 -1
- package/package.json +5 -5
- package/dist/hdhr/deviceId.js.map +0 -1
package/dist/utils/errors.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
*
|
|
3
3
|
* errors.ts: Error formatting and handling utilities for PrismCast.
|
|
4
4
|
*/
|
|
5
|
-
/* These helpers group the error-handling primitives shared across the application:
|
|
6
|
-
* browser-state failures
|
|
7
|
-
* died apart from a subject that was never there.
|
|
5
|
+
/* These helpers group the error-handling primitives shared across the application: normalizers that turn an arbitrary thrown value into log-ready text or into
|
|
6
|
+
* an Error, and classifiers of browser-state failures, so a retry loop aborts as soon as the session it was retrying against is gone and a caller can tell a
|
|
7
|
+
* page that died apart from a subject that was never there.
|
|
8
8
|
*/
|
|
9
9
|
/**
|
|
10
10
|
* Formats an error for logging by extracting the message if available, falling back to string conversion for non-Error objects. Trailing punctuation is stripped
|
|
@@ -26,6 +26,15 @@ export function formatError(error) {
|
|
|
26
26
|
// Strip trailing punctuation to prevent double punctuation when callers add their own.
|
|
27
27
|
return message.replace(/[.!?]+$/, "");
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Normalizes an unknown rejection value into an Error. An Error passes through unchanged; any other value becomes an Error whose message is the value's
|
|
31
|
+
* formatted text, with the original value kept as its cause so nothing is lost.
|
|
32
|
+
* @param error - The value a promise rejected with or a catch received.
|
|
33
|
+
* @returns The value itself when it is an Error, otherwise a new Error carrying it as the cause.
|
|
34
|
+
*/
|
|
35
|
+
export function toError(error) {
|
|
36
|
+
return (error instanceof Error) ? error : new Error(formatError(error), { cause: error });
|
|
37
|
+
}
|
|
29
38
|
/**
|
|
30
39
|
* Checks whether an error indicates that the browser page or session has been closed or is otherwise unrecoverable. These errors should cause immediate abort of
|
|
31
40
|
* any retry loops rather than continuing to retry an operation that will never succeed. Common unrecoverable errors include closed targets, closed sessions, and
|
package/dist/utils/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;GAGG;AAEH;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,KAAc;IAExC,IAAI,OAAe,CAAC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IAE7C,IAAG,oBAAoB,CAAC,KAAK,CAAC,EAAE,CAAC;QAE/B,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,OAAO,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;IAEjD,MAAM,oBAAoB,GAAG,CAAE,uCAAuC,EAAE,oCAAoC,EAAE,iCAAiC;QAC7I,oBAAoB,EAAE,oBAAoB,CAAE,CAAC;IAE/C,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -2,16 +2,16 @@ import type { Clock } from "homebridge-plugin-utils";
|
|
|
2
2
|
import type { Nullable } from "../types/index.ts";
|
|
3
3
|
export type LogColor = "cyan" | "red" | "yellow" | null;
|
|
4
4
|
/**
|
|
5
|
-
* Initializes the file logger. Creates the log file
|
|
6
|
-
*
|
|
7
|
-
* outcome leaves the startup window behind.
|
|
5
|
+
* Initializes the file logger. Creates the log file and its parent directory when either is missing. A call is the one initialization of the process: it enters
|
|
6
|
+
* open, leaving the window's entries in the buffer for the first flush to append, or off, discarding them. Either outcome leaves the startup window behind.
|
|
8
7
|
* @param logPath - Absolute path to the log file, resolved by the caller via getLogFilePath().
|
|
9
8
|
* @param maxSize - Maximum log file size in bytes from CONFIG.logging.maxSize.
|
|
10
9
|
* @param clock - The clock the flush interval arms on and the pause stamps read; defaults to the system clock.
|
|
11
10
|
*/
|
|
12
11
|
export declare function initializeFileLogger(logPath: string, maxSize: number, clock?: Clock): Promise<void>;
|
|
13
12
|
/**
|
|
14
|
-
* Writes a log entry
|
|
13
|
+
* Writes a log entry where the lifecycle state sends it. The window holds it for the first flush, dropping the oldest held entry past STARTUP_BUFFER_LIMIT; open
|
|
14
|
+
* and closing buffer it for the periodic or final flush, and a paused file drops it until the retry delay passes; closed appends it synchronously; off discards it.
|
|
15
15
|
* @param level - Log level ("info", "warn", "error", "debug").
|
|
16
16
|
* @param message - The formatted log message.
|
|
17
17
|
* @param color - Color name accepted by node:util.styleText, or null for the default terminal color.
|
|
@@ -31,19 +31,30 @@ export declare function flushLogBuffer(): Promise<void>;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function flushLogBufferSync(fallbackPath?: string): void;
|
|
33
33
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Sets the maximum log file size and checks the open file against it at once, so a saved smaller limit trims an oversized file without waiting for the next
|
|
35
|
+
* periodic check. The limit is assigned before the check starts, so every check and trim from here on reads it whether or not the caller awaits the setter.
|
|
36
|
+
* The check returns when no file is open or the open file is paused, and skips the trim while debug logging is active, as the periodic check does.
|
|
37
|
+
* @param maxSize - The maximum log file size in bytes.
|
|
38
|
+
* @returns A promise that resolves once the size check, and any trim it started, completes.
|
|
39
|
+
*/
|
|
40
|
+
export declare function setMaxLogSize(maxSize: number): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Pure trim logic: given the log file's bytes and the configured maximum size, returns the trimmed bytes (keeping complete lines from the file's tail) or null
|
|
43
|
+
* when no trim is needed (the file is already at or below half maxSize). Extracted from trimLogFile so the cut is testable in isolation without orchestrating
|
|
44
|
+
* real filesystem I/O - the surrounding read/write/rename chain is small enough to be exercised at the integration level.
|
|
45
|
+
*
|
|
46
|
+
* Algorithm: the target is half of maxSize, rounded down, and the cut sits at the buffer's length minus the target, so the kept tail is at most half the limit.
|
|
47
|
+
* The kept tail starts after the first newline byte at or past the cut, so the trimmed file begins on a complete line, and that start is a whole character
|
|
48
|
+
* because a newline byte never lies inside a multi-byte sequence. With no newline past the cut, the kept tail is the end of one line, and a cut inside a
|
|
49
|
+
* multi-byte sequence advances past its continuation bytes to the next lead byte, so the kept tail never opens mid-character.
|
|
37
50
|
*
|
|
38
|
-
*
|
|
39
|
-
* begins on a complete line. If no newline exists past the cut, the cut position is taken as-is (the trim still drops earlier content even if the kept tail is
|
|
40
|
-
* a single fragment line).
|
|
51
|
+
* The result is a subarray of the input, so the trim writes back the bytes it read rather than decoding the file and encoding it again.
|
|
41
52
|
*
|
|
42
|
-
* @param content - The
|
|
53
|
+
* @param content - The log file's content, as read from disk.
|
|
43
54
|
* @param maxSize - The configured maximum log file size in bytes.
|
|
44
55
|
* @returns The trimmed content, or null when no trim is needed.
|
|
45
56
|
*/
|
|
46
|
-
export declare function computeTrimmedLogContent(content:
|
|
57
|
+
export declare function computeTrimmedLogContent(content: Buffer, maxSize: number): Nullable<Buffer>;
|
|
47
58
|
/**
|
|
48
59
|
* Shuts down the file logger: enters the closing state, waits for the write chain to drain, then flushes any remaining buffer synchronously and enters closed.
|
|
49
60
|
*
|
package/dist/utils/fileLogger.js
CHANGED
|
@@ -7,14 +7,16 @@ import path from "node:path";
|
|
|
7
7
|
import { styleText } from "node:util";
|
|
8
8
|
import { systemClock } from "homebridge-plugin-utils";
|
|
9
9
|
const { promises: fsPromises } = fs;
|
|
10
|
-
/* The file logger provides persistent logging to a configurable log file with automatic size-based trimming. When the log file exceeds the
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
/* The file logger provides persistent logging to a configurable log file with automatic size-based trimming. When the log file's size in bytes exceeds the
|
|
11
|
+
* configured maximum, it is trimmed to at most half the maximum, keeping the most recent complete lines. The trim measures and cuts in bytes, the unit of the limit
|
|
12
|
+
* and of the size check, so a log of multi-byte text is held to the same bound an ASCII log is. This approach prevents unbounded log growth while maintaining
|
|
13
|
+
* recent history for troubleshooting.
|
|
13
14
|
*
|
|
14
15
|
* Design decisions:
|
|
15
16
|
*
|
|
16
17
|
* 1. Asynchronous buffered writes - Logs are collected in a buffer and flushed periodically to avoid blocking the event loop during high-frequency logging.
|
|
17
|
-
* 2.
|
|
18
|
+
* 2. Size checking - File size is checked every N writes rather than on each write to minimize syscall overhead, and once more when setMaxLogSize() receives a
|
|
19
|
+
* saved limit, so a smaller limit trims an oversized file at once. Each check starts only while the logger is open on a file that is accepting writes.
|
|
18
20
|
* 3. Atomic trim operations - Trimming writes to a temp file then renames, preventing data loss if the process crashes during trim.
|
|
19
21
|
* 4. Timestamps - Delegates to formatTimestamp() in utils/format.ts, which emits yyyy/mm/dd hh:mm:ss.mmm AM/PM. The same helper feeds the console method
|
|
20
22
|
* wrappers in app.ts and the Morgan HTTP request logger, so file, console, and request logs share identical timestamps.
|
|
@@ -25,8 +27,10 @@ const { promises: fsPromises } = fs;
|
|
|
25
27
|
* worth logging. Entries emitted in the window state, before the one initialization, are held in the write buffer and appended by the first flush after it,
|
|
26
28
|
* so the log file opens with the boot messages that preceded it. The window is bounded, and the initialization leaves it whether it succeeds or fails.
|
|
27
29
|
*/
|
|
28
|
-
/* The file logger's module state: the lifecycle state that says where a line goes, plus the bookkeeping of the file it is open on.
|
|
29
|
-
*
|
|
30
|
+
/* The file logger's module state: the lifecycle state that says where a line goes, plus the bookkeeping of the file it is open on. The initializeFileLogger()
|
|
31
|
+
* call during server startup sets the lifecycle state, the clock and the size cap, and setMaxLogSize() replaces the size cap when a saved limit changes it. The
|
|
32
|
+
* buffer, the write counter and the write chain start from their module initializers and shutdownFileLogger() resets them; a failed initialization also empties
|
|
33
|
+
* the buffer.
|
|
30
34
|
*/
|
|
31
35
|
// Where the logger is in its lifecycle. Only transition() assigns it, which is what gives the flush timer a single owner.
|
|
32
36
|
let state = { kind: "window" };
|
|
@@ -34,7 +38,8 @@ let state = { kind: "window" };
|
|
|
34
38
|
* line, and rebuilding a state object per line would allocate on every log call.
|
|
35
39
|
*/
|
|
36
40
|
let writeBuffer = [];
|
|
37
|
-
//
|
|
41
|
+
// The running count of lines the open and closing states buffer, whose multiples of SIZE_CHECK_FREQUENCY trigger the periodic size check, reset at shutdown. It
|
|
42
|
+
// sits beside the state for the same reason the buffer does - that write path bumps it once per buffered line.
|
|
38
43
|
let writeCount = 0;
|
|
39
44
|
/* Tail of the write-ordering chain, the open file's bookkeeping rather than a member of its state. Every asynchronous mutation of the log file (buffer flushes
|
|
40
45
|
* and trims) is appended to this promise so that the operations run strictly one after another. Without this serialization a flush's appendFile could land
|
|
@@ -47,8 +52,10 @@ let writeChain = Promise.resolve();
|
|
|
47
52
|
// How long shutdown waits for the outstanding write chain to drain. Generous enough for a trim's read, write, and rename on a busy disk, and short enough that a
|
|
48
53
|
// wedged filesystem operation cannot hold the process open through its own shutdown.
|
|
49
54
|
const SHUTDOWN_DRAIN_BOUND_MS = 5000;
|
|
50
|
-
// Maximum log file size, set
|
|
51
|
-
|
|
55
|
+
// Maximum log file size in bytes, set by initialization and by setMaxLogSize(). It is configuration the size check and the trim read rather than lifecycle, so
|
|
56
|
+
// it stays beside the state. It has no initial value because nothing reads it before initialization assigns the configured cap: the size check and the trim run
|
|
57
|
+
// only in the open state, which initialization enters after that assignment.
|
|
58
|
+
let maxLogSize;
|
|
52
59
|
/* The clock the flush interval arms on and the pause stamps read, set during initialization. It is per-run configuration the way the size cap is, so it stays
|
|
53
60
|
* beside the state rather than inside it: a member of the open variant would put the clock's lifetime where the file keeps lifecycle, and the closing and closed
|
|
54
61
|
* states read it too.
|
|
@@ -98,9 +105,8 @@ function openFilePath() {
|
|
|
98
105
|
}
|
|
99
106
|
// Initialization.
|
|
100
107
|
/**
|
|
101
|
-
* Initializes the file logger. Creates the log file
|
|
102
|
-
*
|
|
103
|
-
* outcome leaves the startup window behind.
|
|
108
|
+
* Initializes the file logger. Creates the log file and its parent directory when either is missing. A call is the one initialization of the process: it enters
|
|
109
|
+
* open, leaving the window's entries in the buffer for the first flush to append, or off, discarding them. Either outcome leaves the startup window behind.
|
|
104
110
|
* @param logPath - Absolute path to the log file, resolved by the caller via getLogFilePath().
|
|
105
111
|
* @param maxSize - Maximum log file size in bytes from CONFIG.logging.maxSize.
|
|
106
112
|
* @param clock - The clock the flush interval arms on and the pause stamps read; defaults to the system clock.
|
|
@@ -169,7 +175,8 @@ function formatLogEntry(level, message, color, categoryTag) {
|
|
|
169
175
|
return "[" + timestamp + "] " + coloredBody + "\n";
|
|
170
176
|
}
|
|
171
177
|
/**
|
|
172
|
-
* Writes a log entry
|
|
178
|
+
* Writes a log entry where the lifecycle state sends it. The window holds it for the first flush, dropping the oldest held entry past STARTUP_BUFFER_LIMIT; open
|
|
179
|
+
* and closing buffer it for the periodic or final flush, and a paused file drops it until the retry delay passes; closed appends it synchronously; off discards it.
|
|
173
180
|
* @param level - Log level ("info", "warn", "error", "debug").
|
|
174
181
|
* @param message - The formatted log message.
|
|
175
182
|
* @param color - Color name accepted by node:util.styleText, or null for the default terminal color.
|
|
@@ -209,7 +216,8 @@ export function writeLogEntry(level, message, color, categoryTag) {
|
|
|
209
216
|
}
|
|
210
217
|
case "closed": {
|
|
211
218
|
/* The logger has shut down and this line still belongs to the run that just ended, so it goes to that run's file. The append is synchronous because
|
|
212
|
-
* nothing asynchronous is left to carry it: the flush timer is stopped, the write chain has drained, and the process may exit
|
|
219
|
+
* nothing asynchronous is left to carry it: the flush timer is stopped, the write chain has drained or its bounded wait has lapsed, and the process may exit
|
|
220
|
+
* on the next tick. A lapsed drain can leave a trim's rename pending, which would replace the file under this append.
|
|
213
221
|
*/
|
|
214
222
|
try {
|
|
215
223
|
fs.appendFileSync(state.path, formatLogEntry(level, message, color, categoryTag), "utf-8");
|
|
@@ -320,13 +328,29 @@ export function flushLogBufferSync(fallbackPath) {
|
|
|
320
328
|
}
|
|
321
329
|
// Size Management.
|
|
322
330
|
/**
|
|
323
|
-
*
|
|
331
|
+
* Sets the maximum log file size and checks the open file against it at once, so a saved smaller limit trims an oversized file without waiting for the next
|
|
332
|
+
* periodic check. The limit is assigned before the check starts, so every check and trim from here on reads it whether or not the caller awaits the setter.
|
|
333
|
+
* The check returns when no file is open or the open file is paused, and skips the trim while debug logging is active, as the periodic check does.
|
|
334
|
+
* @param maxSize - The maximum log file size in bytes.
|
|
335
|
+
* @returns A promise that resolves once the size check, and any trim it started, completes.
|
|
336
|
+
*/
|
|
337
|
+
export async function setMaxLogSize(maxSize) {
|
|
338
|
+
maxLogSize = maxSize;
|
|
339
|
+
await checkAndTrimFile();
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Checks the open file's size in bytes and trims it when it exceeds the maximum. The write path runs the check every SIZE_CHECK_FREQUENCY writes, and
|
|
343
|
+
* setMaxLogSize() runs it once for a saved limit.
|
|
324
344
|
*/
|
|
325
345
|
async function checkAndTrimFile() {
|
|
326
|
-
|
|
327
|
-
|
|
346
|
+
/* A check starts only while the logger is open and its file is accepting writes. A trim started while the logger is closing would land on the write chain
|
|
347
|
+
* outside the drain shutdown awaits, where its rename could replace the file under the final flush, so no check starts once shutdown has begun, from the
|
|
348
|
+
* write path or from a save. A paused file takes no size check, as the write path takes none while it drops entries.
|
|
349
|
+
*/
|
|
350
|
+
if ((state.kind !== "open") || (state.pausedSince !== null)) {
|
|
328
351
|
return;
|
|
329
352
|
}
|
|
353
|
+
const targetPath = state.path;
|
|
330
354
|
try {
|
|
331
355
|
const stats = await fsPromises.stat(targetPath);
|
|
332
356
|
// Skip trimming when debug logging is active. Debug sessions generate high-volume output that is valuable for diagnosis - trimming mid-session would discard
|
|
@@ -343,15 +367,18 @@ async function checkAndTrimFile() {
|
|
|
343
367
|
}
|
|
344
368
|
}
|
|
345
369
|
/**
|
|
346
|
-
* Pure trim logic: given the
|
|
347
|
-
*
|
|
348
|
-
*
|
|
370
|
+
* Pure trim logic: given the log file's bytes and the configured maximum size, returns the trimmed bytes (keeping complete lines from the file's tail) or null
|
|
371
|
+
* when no trim is needed (the file is already at or below half maxSize). Extracted from trimLogFile so the cut is testable in isolation without orchestrating
|
|
372
|
+
* real filesystem I/O - the surrounding read/write/rename chain is small enough to be exercised at the integration level.
|
|
349
373
|
*
|
|
350
|
-
* Algorithm: target half of maxSize
|
|
351
|
-
*
|
|
352
|
-
* a
|
|
374
|
+
* Algorithm: the target is half of maxSize, rounded down, and the cut sits at the buffer's length minus the target, so the kept tail is at most half the limit.
|
|
375
|
+
* The kept tail starts after the first newline byte at or past the cut, so the trimmed file begins on a complete line, and that start is a whole character
|
|
376
|
+
* because a newline byte never lies inside a multi-byte sequence. With no newline past the cut, the kept tail is the end of one line, and a cut inside a
|
|
377
|
+
* multi-byte sequence advances past its continuation bytes to the next lead byte, so the kept tail never opens mid-character.
|
|
353
378
|
*
|
|
354
|
-
*
|
|
379
|
+
* The result is a subarray of the input, so the trim writes back the bytes it read rather than decoding the file and encoding it again.
|
|
380
|
+
*
|
|
381
|
+
* @param content - The log file's content, as read from disk.
|
|
355
382
|
* @param maxSize - The configured maximum log file size in bytes.
|
|
356
383
|
* @returns The trimmed content, or null when no trim is needed.
|
|
357
384
|
*/
|
|
@@ -364,42 +391,47 @@ export function computeTrimmedLogContent(content, maxSize) {
|
|
|
364
391
|
// File is smaller than target, no trimming needed.
|
|
365
392
|
return null;
|
|
366
393
|
}
|
|
367
|
-
// Find the next newline after the cut position to keep complete lines.
|
|
368
|
-
|
|
369
|
-
if (
|
|
370
|
-
// No newline found after cut position, keep from cut position.
|
|
371
|
-
lineStart = cutPosition;
|
|
372
|
-
}
|
|
373
|
-
else {
|
|
394
|
+
// Find the next newline at or after the cut position to keep complete lines.
|
|
395
|
+
const newlinePosition = content.indexOf("\n", cutPosition);
|
|
396
|
+
if (newlinePosition !== -1) {
|
|
374
397
|
// Start after the newline.
|
|
375
|
-
|
|
398
|
+
return content.subarray(newlinePosition + 1);
|
|
399
|
+
}
|
|
400
|
+
// No newline past the cut. A continuation byte, one whose top two bits read 10, is never the first byte of a character, so the cut advances past any it lands
|
|
401
|
+
// on to the next lead byte; an advance that reaches the end keeps nothing.
|
|
402
|
+
let lineStart = cutPosition;
|
|
403
|
+
while ((lineStart < content.length) && ((content.readUInt8(lineStart) & 0xC0) === 0x80)) {
|
|
404
|
+
lineStart++;
|
|
376
405
|
}
|
|
377
|
-
return content.
|
|
406
|
+
return content.subarray(lineStart);
|
|
378
407
|
}
|
|
379
408
|
/**
|
|
380
|
-
* Trims the log file to half the maximum size, keeping
|
|
381
|
-
*
|
|
409
|
+
* Trims the log file to at most half the maximum size, keeping the most recent complete lines. Pure cut logic lives in computeTrimmedLogContent; this function
|
|
410
|
+
* is the I/O orchestration shell around it, reading the file as bytes and writing back the subarray the cut returns.
|
|
382
411
|
*
|
|
383
412
|
* The entire read/write/rename critical section runs inside the write-ordering chain so it is serialized against buffer flushes. This closes the trim/flush race:
|
|
384
413
|
* an appendFile cannot land between this function's readFile and its rename, so the rename never overwrites freshly appended lines with a stale snapshot.
|
|
385
414
|
*/
|
|
386
415
|
async function trimLogFile() {
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
416
|
+
/* The size check made this test before its stat, and it is made again here because a shutdown or a failed flush can move the state while that stat is awaited.
|
|
417
|
+
* The test and the enqueue below run in one synchronous step, so a trim either joins the write chain a shutdown's drain awaits or never starts. The path comes
|
|
418
|
+
* from the state the test read, because a shutdown can move the state under the serialized operation, and the rename has to land on the file the read came
|
|
419
|
+
* from rather than on wherever the logger has since gone.
|
|
420
|
+
*/
|
|
421
|
+
if ((state.kind !== "open") || (state.pausedSince !== null)) {
|
|
391
422
|
return;
|
|
392
423
|
}
|
|
424
|
+
const targetPath = state.path;
|
|
393
425
|
return serializeWrite(async () => {
|
|
394
426
|
try {
|
|
395
|
-
const content = await fsPromises.readFile(targetPath
|
|
427
|
+
const content = await fsPromises.readFile(targetPath);
|
|
396
428
|
const trimmedContent = computeTrimmedLogContent(content, maxLogSize);
|
|
397
429
|
if (trimmedContent === null) {
|
|
398
430
|
return;
|
|
399
431
|
}
|
|
400
432
|
// Write to temp file, then rename (atomic replace).
|
|
401
433
|
const tempPath = targetPath + ".tmp";
|
|
402
|
-
await fsPromises.writeFile(tempPath, trimmedContent
|
|
434
|
+
await fsPromises.writeFile(tempPath, trimmedContent);
|
|
403
435
|
await fsPromises.rename(tempPath, targetPath);
|
|
404
436
|
}
|
|
405
437
|
catch (error) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileLogger.js","sourceRoot":"","sources":["../../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GAAG,KAAK,CAAC,IAAI,CAAC;IAE9B;;;OAGG;IACH,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAElD,4JAA4J;IAC5J,uIAAuI;IACvI,MAAM,WAAW,CAAC,UAAU,EAAE,uBAAuB,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,wCAAwC;IACxC,kBAAkB,EAAE,CAAC;IAErB,UAAU,GAAG,CAAC,CAAC;IACf,WAAW,GAAG,EAAE,CAAC;IAEjB,8JAA8J;IAC9J,oBAAoB;IACpB,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAEjD,yJAAyJ;IACzJ,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NextFunction, Request, Response } from "express";
|
|
2
|
+
/**
|
|
3
|
+
* Handles an error a route threw or passed on, installed as the last middleware of the main application and of the HDHomeRun server, so a request failure in
|
|
4
|
+
* any PrismCast application reaches the project logger rather than Express's console fallback, and a client never receives a stack trace. While the response has
|
|
5
|
+
* not started, it answers 500 with a sentence. Once headers are sent the status line is already on the wire and no answer can replace it, so the error goes on
|
|
6
|
+
* to Express's default handler, which closes the connection rather than leaving a half-written response open. Express recognizes an error handler by its four
|
|
7
|
+
* parameters, which is why next stays in the signature on the path that does not call it.
|
|
8
|
+
* @param error - The error the route raised.
|
|
9
|
+
* @param req - The request that failed.
|
|
10
|
+
* @param res - The response to answer on.
|
|
11
|
+
* @param next - Express's next function, handed the error once headers are sent.
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleRequestError(error: unknown, req: Request, res: Response, next: NextFunction): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { LOG } from "./logger.js";
|
|
2
|
+
import { formatError } from "./errors.js";
|
|
3
|
+
/**
|
|
4
|
+
* Handles an error a route threw or passed on, installed as the last middleware of the main application and of the HDHomeRun server, so a request failure in
|
|
5
|
+
* any PrismCast application reaches the project logger rather than Express's console fallback, and a client never receives a stack trace. While the response has
|
|
6
|
+
* not started, it answers 500 with a sentence. Once headers are sent the status line is already on the wire and no answer can replace it, so the error goes on
|
|
7
|
+
* to Express's default handler, which closes the connection rather than leaving a half-written response open. Express recognizes an error handler by its four
|
|
8
|
+
* parameters, which is why next stays in the signature on the path that does not call it.
|
|
9
|
+
* @param error - The error the route raised.
|
|
10
|
+
* @param req - The request that failed.
|
|
11
|
+
* @param res - The response to answer on.
|
|
12
|
+
* @param next - Express's next function, handed the error once headers are sent.
|
|
13
|
+
*/
|
|
14
|
+
export function handleRequestError(error, req, res, next) {
|
|
15
|
+
LOG.error("A request failed with an unhandled error.", { error: formatError(error), method: req.method, url: req.originalUrl });
|
|
16
|
+
if (res.headersSent) {
|
|
17
|
+
next(error);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
res.status(500).send("Internal server error.");
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=httpErrors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"httpErrors.js","sourceRoot":"","sources":["../../src/utils/httpErrors.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAc,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB;IAEhG,GAAG,CAAC,KAAK,CAAC,2CAA2C,EAAE,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,CAAC;IAEhI,IAAG,GAAG,CAAC,WAAW,EAAE,CAAC;QAEnB,IAAI,CAAC,KAAK,CAAC,CAAC;QAEZ,OAAO;IACT,CAAC;IAED,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export * from "./chromeFetch.ts";
|
|
|
3
3
|
export * from "./cliOutput.ts";
|
|
4
4
|
export * from "./debugFilter.ts";
|
|
5
5
|
export * from "./delay.ts";
|
|
6
|
+
export * from "./deviceId.ts";
|
|
6
7
|
export * from "./errors.ts";
|
|
7
8
|
export * from "./evaluate.ts";
|
|
8
9
|
export * from "./ffmpeg.ts";
|
|
9
10
|
export * from "./format.ts";
|
|
11
|
+
export * from "./httpErrors.ts";
|
|
10
12
|
export * from "./logEmitter.ts";
|
|
11
13
|
export * from "./logger.ts";
|
|
12
14
|
export * from "./m3u.ts";
|
|
@@ -15,6 +17,7 @@ export * from "./morganStream.ts";
|
|
|
15
17
|
export * from "./network.ts";
|
|
16
18
|
export * from "./never.ts";
|
|
17
19
|
export * from "./pid.ts";
|
|
20
|
+
export * from "./plainObject.ts";
|
|
18
21
|
export * from "./platform.ts";
|
|
19
22
|
export * from "./processInspector.ts";
|
|
20
23
|
export * from "./retry.ts";
|
package/dist/utils/index.js
CHANGED
|
@@ -7,10 +7,12 @@ export * from "./chromeFetch.js";
|
|
|
7
7
|
export * from "./cliOutput.js";
|
|
8
8
|
export * from "./debugFilter.js";
|
|
9
9
|
export * from "./delay.js";
|
|
10
|
+
export * from "./deviceId.js";
|
|
10
11
|
export * from "./errors.js";
|
|
11
12
|
export * from "./evaluate.js";
|
|
12
13
|
export * from "./ffmpeg.js";
|
|
13
14
|
export * from "./format.js";
|
|
15
|
+
export * from "./httpErrors.js";
|
|
14
16
|
export * from "./logEmitter.js";
|
|
15
17
|
export * from "./logger.js";
|
|
16
18
|
export * from "./m3u.js";
|
|
@@ -19,6 +21,7 @@ export * from "./morganStream.js";
|
|
|
19
21
|
export * from "./network.js";
|
|
20
22
|
export * from "./never.js";
|
|
21
23
|
export * from "./pid.js";
|
|
24
|
+
export * from "./plainObject.js";
|
|
22
25
|
export * from "./platform.js";
|
|
23
26
|
export * from "./processInspector.js";
|
|
24
27
|
export * from "./retry.js";
|
package/dist/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,uBAAuB,CAAC;AACtC,cAAc,YAAY,CAAC;AAC3B,cAAc,sBAAsB,CAAC;AACrC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
package/dist/utils/logger.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare function isConsoleLogging(): boolean;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare function setDebugLogging(enabled: boolean): void;
|
|
16
16
|
/**
|
|
17
|
-
* Returns whether any debug
|
|
18
|
-
* @returns True if any debug
|
|
17
|
+
* Returns whether any debug filter pattern is configured. An exclude-only pattern counts, so a true answer does not mean a category is enabled.
|
|
18
|
+
* @returns True if any debug filter pattern is configured, including an exclude-only pattern, false otherwise.
|
|
19
19
|
*/
|
|
20
20
|
export declare function isDebugLogging(): boolean;
|
|
21
21
|
/**
|
|
@@ -38,12 +38,13 @@ interface BoundLogger {
|
|
|
38
38
|
}
|
|
39
39
|
export declare const LOG: {
|
|
40
40
|
/**
|
|
41
|
-
* Logs a debug message in cyan, filtered by category. Debug messages are only
|
|
42
|
-
* variable
|
|
41
|
+
* Logs a debug message in cyan, filtered by category. Debug messages are output only when the debug filter in debugFilter.ts enables the specified category.
|
|
42
|
+
* The filter is set by the PRISMCAST_DEBUG environment variable, by the --debug CLI flag (which enables all categories), or from the /debug page, whose filter
|
|
43
|
+
* is persisted in the configuration and applied at startup. Use this for verbose diagnostic information that would clutter normal logs.
|
|
43
44
|
*
|
|
44
45
|
* Stream ID is automatically included if running within a stream context (established by runWithStreamContext()).
|
|
45
46
|
* @param category - The debug category (e.g., "tuning:hulu", "recovery:tab", "streaming:segmenter").
|
|
46
|
-
* @param message - The format string (supports %s, %d, %j, %o).
|
|
47
|
+
* @param message - The format string (supports %s, %d, %i, %f, %j, %o, %O, %c).
|
|
47
48
|
* @param args - Values to interpolate into the format string.
|
|
48
49
|
*/
|
|
49
50
|
debug: (category: string, message: string, ...args: unknown[]) => void;
|
|
@@ -52,7 +53,7 @@ export declare const LOG: {
|
|
|
52
53
|
* stream initialization errors. The red color provides immediate visual indication of serious problems requiring attention.
|
|
53
54
|
*
|
|
54
55
|
* Stream ID is automatically included if running within a stream context (established by runWithStreamContext()).
|
|
55
|
-
* @param message - The format string (supports %s, %d, %j, %o).
|
|
56
|
+
* @param message - The format string (supports %s, %d, %i, %f, %j, %o, %O, %c).
|
|
56
57
|
* @param args - Values to interpolate into the format string.
|
|
57
58
|
*/
|
|
58
59
|
error: (message: string, ...args: unknown[]) => void;
|
|
@@ -61,7 +62,7 @@ export declare const LOG: {
|
|
|
61
62
|
* status updates.
|
|
62
63
|
*
|
|
63
64
|
* Stream ID is automatically included if running within a stream context (established by runWithStreamContext()).
|
|
64
|
-
* @param message - The format string (supports %s, %d, %j, %o).
|
|
65
|
+
* @param message - The format string (supports %s, %d, %i, %f, %j, %o, %O, %c).
|
|
65
66
|
* @param args - Values to interpolate into the format string.
|
|
66
67
|
*/
|
|
67
68
|
info: (message: string, ...args: unknown[]) => void;
|
|
@@ -70,7 +71,7 @@ export declare const LOG: {
|
|
|
70
71
|
* recovered from, missing optional features, or degraded functionality.
|
|
71
72
|
*
|
|
72
73
|
* Stream ID is automatically included if running within a stream context (established by runWithStreamContext()).
|
|
73
|
-
* @param message - The format string (supports %s, %d, %j, %o).
|
|
74
|
+
* @param message - The format string (supports %s, %d, %i, %f, %j, %o, %O, %c).
|
|
74
75
|
* @param args - Values to interpolate into the format string.
|
|
75
76
|
*/
|
|
76
77
|
warn: (message: string, ...args: unknown[]) => void;
|