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;
|
const LOGGER_PREFIX_LEN: number = 8;
|
||||||
class Logger {
|
class Logger {
|
||||||
|
_debug: boolean = false;
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
|
this._debug = osEnv("LOGGER") === '*';
|
||||||
}
|
}
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
@@ -716,8 +719,10 @@ class Logger {
|
|||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
debug(...data: any[]) {
|
debug(...data: any[]) {
|
||||||
|
if (this._debug) {
|
||||||
this.log(`[${pad("DEBUG", LOGGER_PREFIX_LEN)}]`, data);
|
this.log(`[${pad("DEBUG", LOGGER_PREFIX_LEN)}]`, data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// deno-lint-ignore no-explicit-any
|
// deno-lint-ignore no-explicit-any
|
||||||
log(prefix: string, data: any[]) {
|
log(prefix: string, data: any[]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user