export interface LogFn { (msg: string, ...args: any[]): void; (obj: object, msg?: string, ...args: any[]): void; } export declare enum LogLevel { FATAL = "fatal", ERROR = "error", WARN = "warn", INFO = "info", DEBUG = "debug", TRACE = "trace" } export interface Logger { /** * Log at `'fatal'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ fatal: LogFn; /** * Log at `'error'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ error: LogFn; /** * Log at `'warn'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ warn: LogFn; /** * Log at `'info'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ info: LogFn; /** * Log at `'debug'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ debug: LogFn; /** * Log at `'trace'` level the given msg. If the first argument is an object, all its properties will be included in the JSON line. * If more args follows `msg`, these will be used to format `msg` using `util.format`. * * @param obj: object to be serialized * @param msg: the log message to write * @param ...args: format string values when `msg` is a format string */ trace: LogFn; }