UNPKG

@xylabs/logger

Version:

XYLabs Logger Library

33 lines 1.12 kB
import type { EnumValue } from '@xylabs/enum'; import { Enum } from '@xylabs/enum'; export type LogFunction = (...data: unknown[]) => void; /** * Interface to handle overlap between Winston & * `console` with as much congruency as possible. */ export interface Logger { debug: LogFunction; error: LogFunction; info: LogFunction; log: LogFunction; warn: LogFunction; } export declare const LogLevel: Enum<{ error: 1; warn: 2; info: 3; log: 4; debug: 5; }>; export type LogLevel = EnumValue<typeof LogLevel>; export declare const NoOpLogFunction: (..._data: unknown[]) => undefined; export declare class ConsoleLogger implements Logger { readonly level: LogLevel; constructor(level?: LogLevel); get debug(): (message?: any, ...optionalParams: any[]) => void; get error(): (message?: any, ...optionalParams: any[]) => void; get info(): (message?: any, ...optionalParams: any[]) => void; get log(): (message?: any, ...optionalParams: any[]) => void; get warn(): (message?: any, ...optionalParams: any[]) => void; } //# sourceMappingURL=Logger.d.ts.map