Skip to content

Commit

Permalink
langserver: Add PID to TCP server log messages
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Mar 30, 2020
1 parent c671c1e commit 08fc441
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions langserver/langserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,15 @@ func (ls *langServer) StartTCP(address string) error {

select {
case <-ls.srvCtx.Done():
ls.logger.Println("Shutting down TCP server ...")
ls.logger.Printf("Stopping TCP server (pid %d) ...", os.Getpid())
err = lst.Close()
if err != nil {
ls.logger.Printf("TCP server failed to shutdown: %s", err)
ls.logger.Printf("TCP server (pid %d) failed to stop: %s", os.Getpid(), err)
return err
}
}

ls.logger.Printf("TCP server (pid %d) stopped.", os.Getpid())
return nil
}

Expand Down

0 comments on commit 08fc441

Please sign in to comment.