@factorial-finance/blueprint-node
Version:
blueprint-node-plugin
44 lines (43 loc) • 1.79 kB
TypeScript
export type LogLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
export interface ILoggerOptions {
level?: LogLevel;
format?: 'simple' | 'json';
timestamp?: boolean;
colors?: boolean;
}
export declare class Logger {
private static instance;
private options;
constructor(options?: ILoggerOptions);
static getInstance(options?: ILoggerOptions): Logger;
static configure(options: ILoggerOptions): Logger;
updateOptions(options: ILoggerOptions): void;
getOptions(): ILoggerOptions;
info(message: string, ...args: any[]): void;
error(message: string, ...args: any[]): void;
warn(message: string, ...args: any[]): void;
debug(message: string, ...args: any[]): void;
log(level: 'info' | 'error' | 'warn' | 'debug', message: string, ...args: any[]): void;
private shouldLog;
private getTimestamp;
private colorizeLevel;
private colorizeMessage;
static info(message: string, ...args: any[]): void;
static error(message: string, ...args: any[]): void;
static warn(message: string, ...args: any[]): void;
static debug(message: string, ...args: any[]): void;
static log(level: 'info' | 'error' | 'warn' | 'debug', message: string, ...args: any[]): void;
static print(message: string, ...args: any[]): void;
static logRPCCall(method: string, params: any): void;
private static formatParams;
static logError(method: string, error: any): void;
static logSeparator(): void;
private static formatAddress;
static setLogLevel(level: LogLevel): void;
static getLogLevel(): LogLevel;
static enableDebugMode(): void;
static enableInfoMode(): void;
static enableSilentMode(): void;
static isDebugEnabled(): boolean;
static isInfoEnabled(): boolean;
}