chore(vscode-ide-companion): revert some log util, will continue next time

This commit is contained in:
yiliang114
2025-12-11 23:57:21 +08:00
parent b34894c8ea
commit c20df192a8
10 changed files with 123 additions and 282 deletions

View File

@@ -1,25 +0,0 @@
/**
* @license
* Copyright 2025 Qwen Team
* SPDX-License-Identifier: Apache-2.0
*/
/**
* Creates a dev-only console logger for the WebView bundle.
* In production builds it becomes a no-op to avoid noisy logs.
*/
export function createWebviewConsoleLogger(scope?: string) {
return (...args: unknown[]) => {
const env = (globalThis as { process?: { env?: Record<string, string> } })
.process?.env;
const isProduction = env?.NODE_ENV === 'production';
if (isProduction) {
return;
}
if (scope) {
console.log(`[${scope}]`, ...args);
return;
}
console.log(...args);
};
}