webrtc2-logger
Version:
WebRTC2 Logger - Structured logging system for WebRTC applications with cross-platform support, debugging tools, and performance monitoring
32 lines (30 loc) • 974 B
text/typescript
/**
* @webrtc2/logger
*
* Structured logging for WebRTC2 ecosystem
*/
type LogLevel = 'debug' | 'info' | 'warn' | 'error';
interface LogEntry {
level: LogLevel;
message: string;
timestamp: Date;
context?: Record<string, any>;
component?: string;
}
declare class Logger {
private component;
private minLevel;
private levels;
constructor(component: string, minLevel?: LogLevel);
private shouldLog;
private log;
debug(message: string, context?: Record<string, any>): void;
info(message: string, context?: Record<string, any>): void;
warn(message: string, context?: Record<string, any>): void;
error(message: string, context?: Record<string, any>): void;
setLevel(level: LogLevel): void;
}
declare const logger: Logger;
declare function createLogger(component: string, level?: LogLevel): Logger;
declare const VERSION = "1.0.0";
export { type LogEntry, type LogLevel, Logger, VERSION, createLogger, logger };