cmdDebugList prints every event currently in the ring, one per line, with a marker for events that have an inspectable payload.
()
| 353 | // cmdDebugList prints every event currently in the ring, one per line, with |
| 354 | // a marker for events that have an inspectable payload. |
| 355 | func cmdDebugList() { |
| 356 | events := debug.Snapshot() |
| 357 | if len(events) == 0 { |
| 358 | fmt.Println(ui.Dimmed("debug log is empty")) |
| 359 | return |
| 360 | } |
| 361 | for _, e := range events { |
| 362 | marker := " " |
| 363 | if e.Payload != "" { |
| 364 | marker = "•" |
| 365 | } |
| 366 | fmt.Printf(" %s #%-4d %s %-10s %s\n", |
| 367 | marker, |
| 368 | e.ID, |
| 369 | ui.Dimmed(e.Time.Format("15:04:05.000")), |
| 370 | e.Source, |
| 371 | e.Message) |
| 372 | } |
| 373 | fmt.Println(ui.Dimmed(fmt.Sprintf("%d events (• = has payload). use /debug show <id> for full content.", len(events)))) |
| 374 | } |
| 375 | |
| 376 | // cmdDebugShow dumps a single event's full payload to scrollback. With no |
| 377 | // argument it shows the most recent event that has a payload. |