MCPcopy Create free account
hub / github.com/GCWing/BitFun / sendDebugProbe

Function sendDebugProbe

src/web-ui/src/shared/utils/debugProbe.ts:31–60  ·  view source on GitHub ↗
(
  location: string,
  message: string,
  data?: DebugProbeData,
  options: DebugProbeOptions = {}
)

Source from the content-addressed store, hash-verified

29}
30
31export function sendDebugProbe(
32 location: string,
33 message: string,
34 data?: DebugProbeData,
35 options: DebugProbeOptions = {}
36): void {
37 const serializedData = data
38 ? Object.fromEntries(
39 Object.entries(data).map(([key, value]) => [key, serializeProbeValue(value)])
40 )
41 : undefined;
42
43 const payload: Record<string, unknown> = {
44 location,
45 ...(serializedData ?? {}),
46 };
47
48 if (
49 options.startedAt !== undefined &&
50 typeof payload.durationMs !== 'number'
51 ) {
52 logElapsed(log, message, options.startedAt, {
53 level: options.level ?? 'debug',
54 data: payload,
55 });
56 return;
57 }
58
59 logWithLevel(log, options.level ?? 'debug', message, payload);
60}

Callers 7

doRefreshMethod · 0.90
GitStateManagerClass · 0.90
useGitStateFunction · 0.90
Terminal.tsxFile · 0.90
MarkdownEditorFunction · 0.90
CodeEditorFunction · 0.90
handleVisibilityChangeFunction · 0.90

Calls 3

logElapsedFunction · 0.90
logWithLevelFunction · 0.90
serializeProbeValueFunction · 0.85

Tested by

no test coverage detected