зеркало из https://github.com/golang/tools.git
internal/lsp: add additional information when logging errors
Fixes golang/go#33499
This logs additional information compatible with `golang.org/x/xerrors` like the frames.
Change-Id: If25c3979cf294dbe55b0e3d9d999b24c1ff8900d
GitHub-Last-Rev: 210fa40bd2
GitHub-Pull-Request: golang/tools#144
Reviewed-on: https://go-review.googlesource.com/c/tools/+/189344
Reviewed-by: Rebecca Stambler <rstambler@golang.org>
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Родитель
07722704da
Коммит
11cc3c157e
|
@ -22,7 +22,11 @@ func (e Event) Format(f fmt.State, r rune) {
|
|||
}
|
||||
fmt.Fprint(f, e.Message)
|
||||
if e.Error != nil {
|
||||
fmt.Fprintf(f, ": %v", e.Error)
|
||||
if f.Flag('+') {
|
||||
fmt.Fprintf(f, ": %+v", e.Error)
|
||||
} else {
|
||||
fmt.Fprintf(f, ": %v", e.Error)
|
||||
}
|
||||
}
|
||||
for _, tag := range e.Tags {
|
||||
fmt.Fprintf(f, "\n\t%v = %v", tag.Key, tag.Value)
|
||||
|
|
Загрузка…
Ссылка в новой задаче