UNPKG

logger4node

Version:

![build](https://github.com/yog27ray/logger4node/actions/workflows/node.js.yml/badge.svg?branch=master) [![codecov](https://codecov.io/gh/yog27ray/logger4node/branch/master/graph/badge.svg)](https://codecov.io/gh/yog27ray/logger4node)

51 lines 1.91 kB
export declare enum LogSeverity { DEBUG = "debug", ERROR = "error", FATAL = "fatal", INFO = "info", VERBOSE = "verbose", WARN = "warn" } export declare interface GithubConfig { basePath: string; commitHash: string; org: string; repo: string; } export declare const LogLevel: Record<LogSeverity, number>; export declare const DisplaySeverityMap: Record<LogSeverity, string>; declare interface LoggerConfig { disableJsonStringify(): boolean; github: GithubConfig; jsonLogging(): boolean; logPattern: LogPattern; logSeverityPattern: LogSeverityPattern; minLogLevelEnabled(): number; } export declare interface LogPattern { negative: Array<string>; positive: Array<string>; } export declare type LogSeverityPattern = Record<LogSeverity, LogPattern>; export declare class Logger { private readonly config; private readonly name; constructor(loggerName: string, config: LoggerConfig); private static errorStack; private static jsonTransformArgs; private static transformArgs; debug(formatter: unknown, ...args: Array<unknown>): void; error(formatter: unknown, ...args: Array<unknown>): void; fatal(formatter: unknown, ...args: Array<unknown>): void; info(formatter: unknown, ...args: Array<unknown>): void; log(logSeverity: LogSeverity, extraData: Record<string, unknown>, formatter: unknown, ...args: Array<unknown>): void; verbose(formatter: unknown, ...args: Array<unknown>): void; warn(formatter: unknown, ...args: Array<unknown>): void; private generateGithubLink; private generateLogSource; private isLogEnabled; } export declare function setLogPattern(logPattern: LogPattern, pattern: string): void; export declare function setLogSeverityPattern(logSeverityPattern: LogSeverityPattern, level: LogSeverity, pattern: string): void; export {}; //# sourceMappingURL=logger.d.ts.map