Add debug log toggle and silence diagnostic logs

This commit is contained in:
Youzini-afk
2026-04-06 11:26:37 +08:00
parent b6187d46e0
commit 8320e3e7f6
23 changed files with 226 additions and 96 deletions

View File

@@ -1,6 +1,7 @@
import { getContext as extensionGetContext } from "../../../../extensions.js";
import { buildCapabilityStatus, mergeVersionHints } from "./capabilities.js";
import { debugDebug } from "../debug-logging.js";
function resolveContextGetter(providedGetter = null) {
if (typeof providedGetter === "function") {
@@ -55,7 +56,7 @@ export function createContextHostFacade(options = {}) {
try {
return getContext(...args);
} catch (error) {
console.debug(
debugDebug(
"[ST-BME] host-adapter/context getContext 调用失败",
error,
);
@@ -71,7 +72,7 @@ export function createContextHostFacade(options = {}) {
const context = getContext(...args);
return context && typeof context === "object" ? context : null;
} catch (error) {
console.debug("[ST-BME] host-adapter/context 读取上下文失败", error);
debugDebug("[ST-BME] host-adapter/context 读取上下文失败", error);
return null;
}
},