From b8444066ea83433c8a3597407a9fb6b9e9e36085 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Mon, 29 Apr 2024 15:06:53 +0530 Subject: fix(ext/node): support NODE_DEBUG env (#23583) --- ext/node/polyfills/internal/util/debuglog.ts | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'ext/node/polyfills/internal/util') diff --git a/ext/node/polyfills/internal/util/debuglog.ts b/ext/node/polyfills/internal/util/debuglog.ts index 3cbcf2c5c..9bbaed606 100644 --- a/ext/node/polyfills/internal/util/debuglog.ts +++ b/ext/node/polyfills/internal/util/debuglog.ts @@ -12,7 +12,7 @@ let debugImpls: Record void>; let testEnabled: (str: string) => boolean; // `debugEnv` is initial value of process.env.NODE_DEBUG -function initializeDebugEnv(debugEnv: string) { +export function initializeDebugEnv(debugEnv: string) { debugImpls = Object.create(null); if (debugEnv) { // This is run before any user code, it's OK not to use primordials. @@ -106,20 +106,4 @@ export function debuglog( return logger; } -let debugEnv; -/* TODO(kt3k): enable initializing debugEnv. -It's not possible to access env var when snapshotting. - -try { - debugEnv = Deno.env.get("NODE_DEBUG") ?? ""; -} catch (error) { - if (error instanceof Deno.errors.PermissionDenied) { - debugEnv = ""; - } else { - throw error; - } -} -*/ -initializeDebugEnv(debugEnv); - export default { debuglog }; -- cgit v1.2.3