check debug env to show debug logs

This commit is contained in:
Dmitriy Pleshevskiy 2022-06-08 23:31:59 +03:00
parent cd91329be0
commit 8409d472bf
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
1 changed files with 4 additions and 1 deletions

5
log.ts
View File

@ -3,5 +3,8 @@ export function info(...args: unknown[]): void {
}
export function debug(...args: unknown[]): void {
console.log("[DEBUG]", ...args);
// choose better name for this env
if (Deno.env.get("DEBUG") === "1") {
console.log("[DEBUG]", ...args);
}
}