yoni-mcscripts-lib
Version:
为 Minecraft Script API 中的部分接口创建了 wrapper,并提供简单的事件管理器和任务管理器,另附有一些便于代码编写的一些小工具。
63 lines (62 loc) • 1.78 kB
TypeScript
declare enum LoggingLevel {
FATAL = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
DEBUG = 4,
TRACE = 5,
VERBOSE = 6
}
export declare const LoggingNameMappings: {
"0": LoggingLevel;
fatal: LoggingLevel;
f: LoggingLevel;
"1": LoggingLevel;
error: LoggingLevel;
e: LoggingLevel;
err: LoggingLevel;
fail: LoggingLevel;
ex: LoggingLevel;
severe: LoggingLevel;
"2": LoggingLevel;
warn: LoggingLevel;
w: LoggingLevel;
warning: LoggingLevel;
notice: LoggingLevel;
"3": LoggingLevel;
info: LoggingLevel;
i: LoggingLevel;
log: LoggingLevel;
"4": LoggingLevel;
debug: LoggingLevel;
d: LoggingLevel;
"5": LoggingLevel;
trace: LoggingLevel;
t: LoggingLevel;
"6": LoggingLevel;
verbose: LoggingLevel;
};
declare class Logger {
#private;
static setConsolePrinter(level: string, printer: (msg: string) => void): void;
static getConsolePrinter(level: string): ((msg: string) => void) | undefined;
static getConsolePrinter(level: string, defaultPrinter: (msg: string) => void): (msg: string) => void;
static removeConsolePrinter(level: string): boolean;
/**
* 向控制台输出日志。
*/
static log(...data: any[]): void;
name: string;
constructor(name: string);
printOnLevel(lv: string, time: Date, msg?: any, ...rps: any[]): Promise<void>;
addLevelLogFunc(level: string, levelCode: LoggingLevel): any;
}
type LoggerNames = {
[levelName in keyof typeof LoggingNameMappings]: (...args: any[]) => void;
};
interface Logger extends LoggerNames {
}
export { Logger };
export declare const console: Logger;
export declare const log: (...args: any[]) => void;
export declare const print: (...args: any[]) => void;