MCPcopy Create free account
hub / github.com/codehamr/codehamr / redactSlash

Function redactSlash

internal/tui/debuglog.go:67–76  ·  view source on GitHub ↗

redactSlash strips the /hamrpass bearer token before it lands in any log. A central hook covers any future secret-bearing command from one place. The split mirrors runSlash's strings.Fields: both must agree on command vs. args, else a multi-line `/hamrpass\n ` (Alt+Enter inserts a literal

(line string)

Source from the content-addressed store, hash-verified

65// timestamp carries the date too (not just the clock) so a shared log is
66// unambiguous across day boundaries and correlatable with other tooling.
67func dbgWritef(category, format string, args ...any) {
68 dbgMu.Lock()
69 defer dbgMu.Unlock()
70 if dbgFile == nil {
71 return
72 }
73 ts := time.Now().Format("2006-01-02 15:04:05.000")
74 body := fmt.Sprintf(format, args...)
75 fmt.Fprintf(dbgFile, "[%s] %s\n%s\n\n", ts, category, body)
76}
77
78// dbgWriteSession records the active backend and context budget once at startup.
79// Behaviour differs sharply by model (different model families fail in

Callers 2

submitMethod · 0.85

Calls

no outgoing calls

Tested by 1