UNPKG

@evojs/logger

Version:
113 lines (112 loc) 2.66 kB
import { LogLevel } from './enums'; import { type LoggerOptions } from './types'; export declare class Logger { static logname: string; private static readonly _pipes; private static readonly _formats; private static readonly _startTimes; private static _loglevelindex; private static _callsiteDepth?; private static _handling; readonly logname: string; private readonly _pipes; private readonly _formats; private readonly _startTimes; private readonly _loglevelindex; private readonly _callsiteDepth?; private readonly _handler; /** * Create new Logger with custom options */ constructor(options?: LoggerOptions); /** * Create a new logger with name and options of current logger. */ setName(name: string): Logger; setName(constructor: Function): Logger; /** * Create a new logger with options of current logger. */ clone(): Logger; /** * Create fatal log. */ fatal(...args: any[]): void; /** * Create error log. */ error(...args: any[]): void; /** * Create warn log. */ warn(...args: any[]): void; /** * Create info log. */ info(...args: any[]): void; /** * Create debug log. Enable debug for working. */ debug(...args: any[]): void; /** * Create verbose log. */ verbose(...args: any[]): void; /** * Create verbose log. */ log(level: LogLevel, name?: string, ...args: any[]): void; /** * Create table log. */ table(message: string, values: any[], level?: LogLevel): void; table(values: any[], level?: LogLevel): void; start(label: string, level?: LogLevel): void; end(label: string, level?: LogLevel): void; private static _handler; private static _handle; /** * Set global options. */ static configure(options: LoggerOptions): void; /** * Create a new logger with the name. */ static setName(name: string): Logger; static setName(constructor: Function): Logger; /** * Create fatal log. */ static fatal(...args: any[]): void; /** * Create error log. */ static error(...args: any[]): void; /** * Create warn log. */ static warn(...args: any[]): void; /** * Create info log. */ static info(...args: any[]): void; /** * Create debug log. */ static debug(...args: any[]): void; /** * Create verbose log. */ static verbose(...args: any[]): void; /** * Create any level log with custom name. */ static log(level: LogLevel, name?: string, ...args: any[]): void; /** * Create table log. */ static table(message: string, values: any[], level?: LogLevel): void; static table(values: any[], level?: LogLevel): void; static start(label: string, level?: LogLevel): void; static end(label: string, level?: LogLevel): void; }