MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / isTraceEnabled

Function isTraceEnabled

apps/kimi-web/src/debug/trace.ts:64–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62let enabledCache: boolean | null = null;
63
64export function isTraceEnabled(): boolean {
65 if (enabledCache !== null) return enabledCache;
66 let enabled = false;
67 try {
68 if (typeof location !== 'undefined') {
69 const v = new URLSearchParams(location.search).get('debug');
70 if (v === '1' || v === 'true') enabled = true;
71 }
72 } catch {
73 // location unavailable
74 }
75 if (!enabled) {
76 enabled = safeGetString(STORAGE_KEYS.debug) === '1';
77 }
78 enabledCache = enabled;
79 return enabled;
80}
81
82// ---------------------------------------------------------------------------
83// Ring buffer + reactivity

Callers 9

traceRestRequestFunction · 0.85
traceRestResponseFunction · 0.85
traceRestFailureFunction · 0.85
traceWsLifecycleFunction · 0.85
traceWsOutFunction · 0.85
traceWsInFunction · 0.85
traceClientLogFunction · 0.85
traceClientEventFunction · 0.85

Calls 2

safeGetStringFunction · 0.90
getMethod · 0.65

Tested by

no test coverage detected