/** * Sets the logging mode. When true, logs go to console with colors. When false, logs go to the file logger. * @param enabled - True to enable console logging, false for file logging. */ export declare function setConsoleLogging(enabled: boolean): void; /** * Returns whether console logging is currently enabled. * @returns True if using console logging, false if using file logging. */ export declare function isConsoleLogging(): boolean; /** * Enables or disables debug logging. When called with true, initializes the debug filter with wildcard (*) to enable all categories. * @param enabled - True to enable all debug logging, false to disable. */ export declare function setDebugLogging(enabled: boolean): void; /** * Returns whether any debug logging is currently enabled. * @returns True if any debug categories are enabled, false otherwise. */ export declare function isDebugLogging(): boolean; /** * Bound logger interface returned by LOG.withStreamId(). Provides the same logging methods but with a fixed stream ID. */ interface BoundLogger { debug: (category: string, message: string, ...args: unknown[]) => void; error: (message: string, ...args: unknown[]) => void; info: (message: string, ...args: unknown[]) => void; warn: (message: string, ...args: unknown[]) => void; } export declare const LOG: { /** * Logs a debug message in cyan, filtered by category. Debug messages are only output when the specified category is enabled via the PRISMCAST_DEBUG environment * variable or the --debug CLI flag (which enables all categories). Use this for verbose diagnostic information that would clutter normal logs. * * Stream ID is automatically included if running within a stream context (established by runWithStreamContext()). * @param category - The debug category (e.g., "tuning:hulu", "recovery:tab", "streaming:segmenter"). * @param message - The format string (supports %s, %d, %j, %o). * @param args - Values to interpolate into the format string. */ debug: (category: string, message: string, ...args: unknown[]) => void; /** * Logs an error message in red. Use this for critical failures that prevent normal operation, such as browser crashes, navigation failures after all retries, or * stream initialization errors. The red color provides immediate visual indication of serious problems requiring attention. * * Stream ID is automatically included if running within a stream context (established by runWithStreamContext()). * @param message - The format string (supports %s, %d, %j, %o). * @param args - Values to interpolate into the format string. */ error: (message: string, ...args: unknown[]) => void; /** * Logs an informational message in the default terminal color. Use this for normal operational messages like startup notifications, successful operations, and * status updates. * * Stream ID is automatically included if running within a stream context (established by runWithStreamContext()). * @param message - The format string (supports %s, %d, %j, %o). * @param args - Values to interpolate into the format string. */ info: (message: string, ...args: unknown[]) => void; /** * Logs a warning message in yellow. Use this for non-critical issues that do not prevent operation but indicate potential problems, such as timeouts that were * recovered from, missing optional features, or degraded functionality. * * Stream ID is automatically included if running within a stream context (established by runWithStreamContext()). * @param message - The format string (supports %s, %d, %j, %o). * @param args - Values to interpolate into the format string. */ warn: (message: string, ...args: unknown[]) => void; /** * Creates a bound logger with a fixed stream ID. Use this when logging about a stream from outside its async context, such as when iterating over multiple streams * in a disconnect handler or cleanup routine. * * Example: * const streamLog = LOG.withStreamId(streamId); * streamLog.warn("Terminating stream due to browser disconnect."); * streamLog.info("Cleanup complete."); * * @param streamId - The stream ID to include in all log messages. * @returns A logger object with debug, error, warn, and info methods that include the specified stream ID. */ withStreamId: (streamId: string) => BoundLogger; }; export {};