fix empty log error

This commit is contained in:
AnilChinchawale 2018-11-22 12:49:50 +05:30
parent 428d3e2f9c
commit 299a93bc8a

View file

@ -133,7 +133,7 @@ func (s *Server) serveRequest(codec ServerCodec, singleShot bool, options CodecO
const size = 64 << 10
buf := make([]byte, size)
buf = buf[:runtime.Stack(buf, false)]
log.Error(string(buf))
log.Error(fmt.Sprintf("RPC serveRequest %s\n", string(buf)))
}
s.codecsMu.Lock()
s.codecs.Remove(codec)
@ -344,8 +344,8 @@ func (s *Server) exec(ctx context.Context, codec ServerCodec, req *serverRequest
}
if err := codec.Write(response); err != nil {
log.Error(fmt.Sprintf("%v\n", err))
codec.Close()
log.Error(fmt.Sprintf("RPC exec %v\n", err))
codec.Close()
}
// when request was a subscribe request this allows these subscriptions to be actived
@ -371,7 +371,7 @@ func (s *Server) execBatch(ctx context.Context, codec ServerCodec, requests []*s
}
if err := codec.Write(responses); err != nil {
log.Error(fmt.Sprintf("%v\n", err))
log.Error(fmt.Sprintf("RPC execBacth %v\n", err))
codec.Close()
}