Skip to content

Commit e52d3d9

Browse files
authored
Enhance logging for handled methods with request ID (microsoft#2625)
1 parent e4833dd commit e52d3d9

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

internal/lsp/server.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,11 @@ func (s *Server) handleRequestOrNotification(ctx context.Context, req *lsproto.R
528528
if handler := handlers()[req.Method]; handler != nil {
529529
start := time.Now()
530530
err := handler(s, ctx, req)
531-
s.logger.Info("handled method '", req.Method, "' (", req.ID, ") in ", time.Since(start))
531+
idStr := ""
532+
if req.ID != nil {
533+
idStr = " (" + req.ID.String() + ")"
534+
}
535+
s.logger.Info("handled method '", req.Method, "'", idStr, " in ", time.Since(start))
532536
return err
533537
}
534538
s.logger.Warn("unknown method '", req.Method, "'")

0 commit comments

Comments
 (0)