feat: move global declare to @ms/ployfill

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-02-01 02:44:23 +08:00
parent 1e00dc6530
commit e2f32fd0bf
4 changed files with 30 additions and 13 deletions

View File

@ -17,7 +17,7 @@ export class MiaoScriptConsole implements Console {
Console: NodeJS.ConsoleConstructor;
private _name: string = '';
private _level: LogLevel = global.debug ? LogLevel.DEBUG : LogLevel.INFO;
private _level: LogLevel = LogLevel.INFO;
protected logger: any;
protected prefix: string = '§6[§bMiaoScript§6]§r ';
@ -25,6 +25,12 @@ export class MiaoScriptConsole implements Console {
constructor(name?: string) {
this.name = name;
this.logger = global.logger;
if (global.debug) {
this._level = LogLevel.DEBUG
}
if (global.level?.toUpperCase() === "TRACE") {
this._level = LogLevel.TRACE
}
}
get name() {