MCPcopy Create free account
hub / github.com/betta-tech/byo-coding-agent / cmdDebug

Function cmdDebug

commands.go:312–351  ·  view source on GitHub ↗
(args string)

Source from the content-addressed store, hash-verified

310}
311
312func cmdDebug(args string) {
313 parts := strings.Fields(args)
314 verb := ""
315 rest := ""
316 if len(parts) > 0 {
317 verb = strings.ToLower(parts[0])
318 }
319 if len(parts) > 1 {
320 rest = parts[1]
321 }
322
323 switch verb {
324 case "":
325 debug.SetEnabled(!debug.Enabled())
326 case "on", "true", "yes":
327 debug.SetEnabled(true)
328 case "off", "false", "no":
329 debug.SetEnabled(false)
330 case "clear":
331 debug.Clear()
332 fmt.Println(ui.Dimmed("debug log cleared"))
333 notifyDebugUI()
334 return
335 case "ls", "list":
336 cmdDebugList()
337 return
338 case "show", "dump":
339 cmdDebugShow(rest)
340 return
341 default:
342 fmt.Printf("unknown value: %s (try on/off/clear/ls/show)\n", verb)
343 return
344 }
345 state := "off"
346 if debug.Enabled() {
347 state = "on"
348 }
349 fmt.Printf("debug: %s\n", state)
350 notifyDebugUI()
351}
352
353// cmdDebugList prints every event currently in the ring, one per line, with
354// a marker for events that have an inspectable payload.

Callers

nothing calls this directly

Calls 7

SetEnabledFunction · 0.92
EnabledFunction · 0.92
ClearFunction · 0.92
DimmedFunction · 0.92
notifyDebugUIFunction · 0.85
cmdDebugListFunction · 0.85
cmdDebugShowFunction · 0.85

Tested by

no test coverage detected