tools/internal/jsonrpc2
Robert Findley 3c49bb7830 gopls: normalize logging attributes
As part of the log audit in golang/go#66746, I noticed several
irregularities addressed by this CL:
- Move "tags" (domain-specific event keys, which are used construct
  labels) closer to the packages that use them. Specifically, the
  internal/event/tag package contained gopls-specific tags, but x/tools
  should not care about gopls.
- Use consistent values for log attributes. For example, "method" was
  being used to mean jsonrpc2 method and Go method. Also, "directory"
  was being used as both file path and URI.
- Use log attributes for the view attributes logged when views are
  created.
- Eliminate (yet another) redundant log during Load.
- Include the ViewID with snapshot.Labels, since snapshot IDs are only
  meaningful relative to a View.

With these changes, my audit of logging is complete.

Fixes golang/go#66746

Change-Id: Iaa60797a7412fb8e222e78e2e58eff2da9563bbb
Reviewed-on: https://go-review.googlesource.com/c/tools/+/579335
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
2024-04-26 20:08:17 +00:00
..
servertest gopls/internal/regtest/bench: refactor and improve benchmarks 2022-08-04 14:58:59 +00:00
conn.go gopls: normalize logging attributes 2024-04-26 20:08:17 +00:00
handler.go internal/event: renaming the main event API functions 2020-04-23 17:21:36 +00:00
jsonrpc2.go internal/jsonrpc2: change jsonrpc2.Conn to be an interface 2020-06-03 17:06:45 +00:00
jsonrpc2_test.go internal/jsonrpc2: change jsonrpc2.Conn to be an interface 2020-06-03 17:06:45 +00:00
labels.go gopls: normalize logging attributes 2024-04-26 20:08:17 +00:00
messages.go internal/jsonrpc2: export WireError type 2024-02-07 19:42:43 +00:00
serve.go all: use constant to avoid repeated definitions 2022-09-19 15:32:23 +00:00
serve_test.go all: fix non-gopls short tests on js/wasm and update for wasip1/wasm 2023-04-20 14:27:21 +00:00
stream.go internal/jsonrpc2: switch to building streams on top of net.Conn 2020-06-03 13:12:18 +00:00
wire.go internal/jsonrpc2: export WireError type 2024-02-07 19:42:43 +00:00
wire_test.go internal/jsonrpc2: omit empty error data 2020-06-24 06:08:01 +00:00