diff --git a/internal/cat/tci_panel.go b/internal/cat/tci_panel.go index d4f064c..566d420 100644 --- a/internal/cat/tci_panel.go +++ b/internal/cat/tci_panel.go @@ -88,6 +88,8 @@ type TCIPanelState struct { // arrives alongside. type tciPanel struct { st TCIPanelState + // logged counts what has been written per message type — see handlePanel. + logged map[string]int } // handlePanel takes the messages the console cares about. @@ -112,12 +114,21 @@ func (t *TCI) handlePanel(name string, get func(int) string, args string) bool { // this is our reading or its doing, and no amount of reasoning will. switch name { case "mute", "sql_enable", "sql_level", "tx_power", "tx_swr", "tune": - // Logged on arrival so an ANSWER can be told from a silence. The - // transmit meters are asked for four times a second while keyed and the - // log showed only the asking, which proves nothing on its own: a reply - // that arrived and failed to parse looks exactly like one that never - // came. - debugLog.Printf("TCI: %s:%s", name, args) + // Logged on arrival so an ANSWER can be told from a SILENCE: the log + // showed the transmit meters being asked for and nothing coming back, + // which on its own proves nothing — a reply that arrived and failed to + // parse leaves exactly the same trace as one that never came. + // + // Capped per message type. The meters are asked for four times a second + // while transmitting, and a diagnostic that fills an evening's log is + // one that gets switched off instead of read. + if t.panel.logged == nil { + t.panel.logged = map[string]int{} + } + if n := t.panel.logged[name]; n < 20 { + t.panel.logged[name] = n + 1 + debugLog.Printf("TCI: %s:%s", name, args) + } } switch name { case "protocol":