node-logger-plus
Version:
node console 有趣的打印 log print 打印颜色 style log 美化 带风格的日志
44 lines (43 loc) • 1.25 kB
TypeScript
import { BusPlus } from 'bus-plus';
export type LoggerConfig = {
log?: boolean;
debug?: boolean;
info?: boolean;
warn?: boolean;
error?: boolean;
table?: boolean;
};
type LogHandlerReturn = Promise<{
enabled: Boolean;
result: any[];
}>;
export declare class Logger extends BusPlus {
logger: Console;
caches: {
[key: string]: Function;
};
loggerConfig: LoggerConfig;
constructor(_logger?: Console);
static decoratorTime(msg: string): string;
static getLocaleDateTime(): string;
static printDateTime(): void;
/**
* 设置loggerConfig.logger 控制对应函数是否打印
* @param config
*/
setConfig(config?: LoggerConfig): void;
getCaches(): {
[key: string]: Function;
};
get instance(): Console;
log(..._message: any[]): LogHandlerReturn;
success(..._message: any[]): LogHandlerReturn;
error(..._message: any[]): LogHandlerReturn;
warn(..._message: any[]): LogHandlerReturn;
info(..._message: any[]): LogHandlerReturn;
debug(..._message: any[]): LogHandlerReturn;
table(..._message: any[]): LogHandlerReturn;
default(..._message: any[]): LogHandlerReturn;
}
export declare const logger: Logger;
export {};