update deno commons mod
This commit is contained in:
@@ -672,7 +672,10 @@ function pad(message: string, length: number): string {
|
||||
}
|
||||
const LOGGER_PREFIX_LEN: number = 8;
|
||||
class Logger {
|
||||
_debug: boolean = false;
|
||||
|
||||
constructor() {
|
||||
this._debug = osEnv("LOGGER") === '*';
|
||||
}
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
@@ -716,7 +719,9 @@ class Logger {
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
debug(...data: any[]) {
|
||||
this.log(`[${pad("DEBUG", LOGGER_PREFIX_LEN)}]`, data);
|
||||
if (this._debug) {
|
||||
this.log(`[${pad("DEBUG", LOGGER_PREFIX_LEN)}]`, data);
|
||||
}
|
||||
}
|
||||
|
||||
// deno-lint-ignore no-explicit-any
|
||||
|
||||
Reference in New Issue
Block a user