@telnyx/webrtc
Version:
Telnyx WebRTC Client
31 lines (30 loc) • 1.03 kB
TypeScript
export declare type LogLevel = 'debug' | 'info' | 'warn' | 'error';
export interface ILogEntry {
timestamp: string;
level: LogLevel;
message: string;
context?: Record<string, unknown>;
}
export interface ILogCollectorOptions {
enabled: boolean;
level: LogLevel;
maxEntries: number;
}
export declare class LogCollector {
private options;
private buffer;
private isCapturing;
constructor(options?: Partial<ILogCollectorOptions>);
start(): void;
stop(): void;
addEntry(level: LogLevel, message: string, context?: Record<string, unknown>): void;
getLogs(): ILogEntry[];
getLogCount(): number;
drain(): ILogEntry[];
clear(): void;
isActive(): boolean;
isEnabled(): boolean;
}
export declare function getGlobalLogCollector(): LogCollector | null;
export declare function setGlobalLogCollector(collector: LogCollector | null): void;
export declare function createLogCollector(options: Partial<ILogCollectorOptions>): LogCollector;