diff --git a/internal/rigctld/rigctld.go b/internal/rigctld/rigctld.go index 0186755..c51a1ca 100644 --- a/internal/rigctld/rigctld.go +++ b/internal/rigctld/rigctld.go @@ -246,6 +246,11 @@ func (s *Server) serve(c net.Conn) { s.releasePTT(fmt.Sprintf("client %s left", c.RemoteAddr())) }() s.log("rigctld: client connected from %s", c.RemoteAddr()) + // The HANDSHAKE is always traced — the first few commands are where a + // client decides to stay or hang up, and a connect that lasted 50 ms left + // nothing in the log to say which answer it disliked. Steady-state polling + // stays behind the CAT trace switch. + traced := 0 r := bufio.NewReader(c) w := bufio.NewWriter(c) for { @@ -265,7 +270,8 @@ func (s *Server) serve(c net.Conn) { // 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() { + if req != "" && (traced < 6 || cat.CIVTraceEnabled()) { + traced++ s.log("rigctld: %s → %q ⇒ %q", c.RemoteAddr(), req, strings.TrimRight(resp, "\r\n")) } if resp != "" {