UNPKG

crann

Version:

Effortless State Synchronization for Web Extensions

44 lines (43 loc) 1.34 kB
export type LogLevel = "debug" | "info" | "warn" | "error"; export declare class Logger { private static debug; private static prefix; private static noOp; private context; private tag; /** * Create a new Logger instance with a specific context */ constructor(context: string); static setDebug(value: boolean): void; static setPrefix(value: string): void; /** * Set a persistent tag for this Logger instance */ setTag(tag: string | null): void; /** * Create a temporary logger with a specific tag * This doesn't modify the original logger instance */ withTag(tag: string): Logger; /** * Get the full context string including tag if present */ private getFullContext; /** * Create the log methods bound to the current context and tag */ private createLogMethods; /** * Log methods that are dynamically created based on current context and tag */ get debug(): (...args: any[]) => void; get log(): (...args: any[]) => void; get info(): (...args: any[]) => void; get warn(): (...args: any[]) => void; get error(): (...args: any[]) => void; /** * Static helper to create a logger with a specific context */ static forContext(context: string, tag?: string): Logger; }