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>
This commit is contained in:
parent
294e1f360c
commit
b835e07c26
1 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue