diff --git a/changelog.json b/changelog.json index 3911ada..c6601fd 100644 --- a/changelog.json +++ b/changelog.json @@ -3,10 +3,12 @@ "version": "0.25.1", "date": "", "en": [ - "Amplifiers: tick the ones sharing a combiner and ON, OFF and OPERATE act on all of them at once. Each keeps its own meters." + "Amplifiers: tick the ones sharing a combiner and ON, OFF and OPERATE act on all of them at once. Each keeps its own meters.", + "Shared CAT: with the wire trace on, every command a client sends and the answer given are logged." ], "fr": [ - "Amplificateurs : coche ceux qui partagent un combiner et ON, OFF et OPERATE agissent sur tous à la fois. Chacun garde ses mesures." + "Amplificateurs : coche ceux qui partagent un combiner et ON, OFF et OPERATE agissent sur tous à la fois. Chacun garde ses mesures.", + "CAT partagé : avec la trace activée, chaque commande envoyée par un client et la réponse donnée sont journalisées." ] }, { diff --git a/internal/rigctld/rigctld.go b/internal/rigctld/rigctld.go index 6bb2261..1f00835 100644 --- a/internal/rigctld/rigctld.go +++ b/internal/rigctld/rigctld.go @@ -32,6 +32,7 @@ package rigctld import ( "bufio" "fmt" + "hamlog/internal/cat" "net" "strconv" "strings" @@ -244,7 +245,18 @@ func (s *Server) serve(c net.Conn) { s.log("rigctld: client %s disconnected", c.RemoteAddr()) return } - resp, quit := s.handle(strings.TrimSpace(line)) + req := strings.TrimSpace(line) + resp, quit := s.handle(req) + // The whole exchange, when tracing is on. + // + // Only PTT transitions were ever recorded, so when JTDX aborted a + // transmission mid-frame the log showed the abort and not the command + // that preceded it — the one thing needed to tell whether OpsLog answered + // something the client could not accept. Behind the same switch as the CAT + // wire trace: this is one line per poll and would drown an ordinary log. + if req != "" && cat.CIVTraceEnabled() { + s.log("rigctld: %s → %q ⇒ %q", c.RemoteAddr(), req, strings.TrimRight(resp, "\r\n")) + } if resp != "" { if _, err := w.WriteString(resp); err != nil { return