Skip to content

Commit b835e07

Browse files
chuckhaChuck Ha
andauthored
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 <cha@nvidia.com>
1 parent 294e1f3 commit b835e07

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mcp/transport.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ func (s *loggingConn) Read(ctx context.Context) (jsonrpc.Message, error) {
230230

231231
if err != nil {
232232
s.mu.Lock()
233-
fmt.Fprintf(s.w, "read error: %v", err)
233+
fmt.Fprintf(s.w, "read error: %v\n", err)
234234
s.mu.Unlock()
235235
} else {
236236
data, err := jsonrpc2.EncodeMessage(msg)
@@ -250,7 +250,7 @@ func (s *loggingConn) Write(ctx context.Context, msg jsonrpc.Message) error {
250250
err := s.delegate.Write(ctx, msg)
251251
if err != nil {
252252
s.mu.Lock()
253-
fmt.Fprintf(s.w, "write error: %v", err)
253+
fmt.Fprintf(s.w, "write error: %v\n", err)
254254
s.mu.Unlock()
255255
} else {
256256
data, err := jsonrpc2.EncodeMessage(msg)

0 commit comments

Comments
 (0)