aboutsummaryrefslogtreecommitdiff
path: root/src/js/_codegen/client-js.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/js/_codegen/client-js.ts')
-rw-r--r--src/js/_codegen/client-js.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/js/_codegen/client-js.ts b/src/js/_codegen/client-js.ts
index bd9ed63f4..4dfa6acf6 100644
--- a/src/js/_codegen/client-js.ts
+++ b/src/js/_codegen/client-js.ts
@@ -16,9 +16,10 @@ let $debug_log_enabled = ((env) => (
.join("_")
.toUpperCase()})
))(Bun.env);
+let $debug_pid_prefix = Bun.env.SHOW_PID === '1';
let $debug_log = $debug_log_enabled ? (...args) => {
// warn goes to stderr without colorizing
- console.warn(Bun.enableANSIColors ? '\\x1b[90m[${publicName}]\\x1b[0m' : '[${publicName}]', ...args);
+ console.warn(($debug_pid_prefix ? \`[\${process.pid}] \` : '') + (Bun.enableANSIColors ? '\\x1b[90m[${publicName}]\\x1b[0m' : '[${publicName}]'), ...args);
} : () => {};
`;
}