mirror of
https://github.com/golang/go
synced 2024-11-05 16:56:16 -07:00
internal/lsp/debug: print the debug port
Print the debug port to stderr when the debug server listens on a dynamic port so that clients can determine which port to use when launching a browser to the debug view. Change-Id: I92f5e334df5cefdf54f7242ac2328b026852c70e Reviewed-on: https://go-review.googlesource.com/c/tools/+/211798 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
62a9628863
commit
6f9e13bbec
@ -9,6 +9,7 @@ import (
|
||||
"context"
|
||||
"go/token"
|
||||
"html/template"
|
||||
stdlog "log"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/pprof"
|
||||
@ -16,6 +17,7 @@ import (
|
||||
"path"
|
||||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
"golang.org/x/tools/internal/span"
|
||||
@ -214,7 +216,12 @@ func Serve(ctx context.Context, addr string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
log.Print(ctx, "Debug serving", tag.Of("Port", listener.Addr().(*net.TCPAddr).Port))
|
||||
|
||||
port := listener.Addr().(*net.TCPAddr).Port
|
||||
if strings.HasSuffix(addr, ":0") {
|
||||
stdlog.Printf("debug server listening on port %d", port)
|
||||
}
|
||||
log.Print(ctx, "Debug serving", tag.Of("Port", port))
|
||||
prometheus := prometheus.New()
|
||||
rpcs := &rpcs{}
|
||||
traces := &traces{}
|
||||
|
Loading…
Reference in New Issue
Block a user