UNPKG

@notross/redis-hub

Version:

A minimal connection hub for Redis in Node.js

38 lines 1.18 kB
import { LoggerCallback, LoggerConfig, LogLevel, LogMethod, LogResult } from '../types'; /** * Logger with in-memory history, optional console output, * and user-supplied callback support. Supports filtering by level. */ export declare class Logger { private callback; private logging; logs: LogResult[]; private levels?; debug: LogMethod; error: LogMethod; info: LogMethod; log: LogMethod; warn: LogMethod; /** * @param props.logging - Whether logs are echoed to console. Defaults to true. * @param props.logLevels - If provided, only these levels will be output. * @param props.callback - Optional function invoked with every log entry. */ constructor(props?: { logging?: boolean; logLevels?: LogLevel[]; callback?: LoggerCallback; }); setup({ callback, logs, levels }: LoggerConfig): void; /** * Internal output to console respecting level filters. * @private */ private output; /** * Core log runner; formats the message, stores it, invokes callback, and outputs. * @private */ private run; } //# sourceMappingURL=logger.d.ts.map