From b835e07c2659e545679f0f1f7d8a1326cebd4220 Mon Sep 17 00:00:00 2001 From: Chuck Ha Date: Mon, 29 Sep 2025 11:19:05 -0700 Subject: [PATCH] mcp: fix inconsistent logging new lines (#541) This change keeps the logging consistent with a new line after each log whether an error or not. Fixes #540 Co-authored-by: Chuck Ha --- mcp/transport.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mcp/transport.go b/mcp/transport.go index d2109e7..a9cfa37 100644 --- a/mcp/transport.go +++ b/mcp/transport.go @@ -230,7 +230,7 @@ func (s *loggingConn) Read(ctx context.Context) (jsonrpc.Message, error) { if err != nil { s.mu.Lock() - fmt.Fprintf(s.w, "read error: %v", err) + fmt.Fprintf(s.w, "read error: %v\n", err) s.mu.Unlock() } else { data, err := jsonrpc2.EncodeMessage(msg) @@ -250,7 +250,7 @@ func (s *loggingConn) Write(ctx context.Context, msg jsonrpc.Message) error { err := s.delegate.Write(ctx, msg) if err != nil { s.mu.Lock() - fmt.Fprintf(s.w, "write error: %v", err) + fmt.Fprintf(s.w, "write error: %v\n", err) s.mu.Unlock() } else { data, err := jsonrpc2.EncodeMessage(msg)