plugeth/p2p/discover
jwasinger 28e7371701
all: replace log15 with slog (#28187)
This PR replaces Geth's logger package (a fork of [log15](https://github.com/inconshreveable/log15)) with an implementation using slog, a logging library included as part of the Go standard library as of Go1.21.

Main changes are as follows:
* removes any log handlers that were unused in the Geth codebase.
* Json, logfmt, and terminal formatters are now slog handlers.
* Verbosity level constants are changed to match slog constant values.  Internal translation is done to make this opaque to the user and backwards compatible with existing `--verbosity` and `--vmodule` options.
* `--log.backtraceat` and `--log.debug` are removed.

The external-facing API is largely the same as the existing Geth logger.  Logger method signatures remain unchanged.

A small semantic difference is that a `Handler` can only be set once per `Logger` and not changed dynamically.  This just means that a new logger must be instantiated every time the handler of the root logger is changed.

----
For users of the `go-ethereum/log` module. If you were using this module for your own project, you will need to change the initialization. If you previously did 
```golang
log.Root().SetHandler(log.LvlFilterHandler(log.LvlInfo, log.StreamHandler(os.Stderr, log.TerminalFormat(true))))
```
You now instead need to do 
```golang
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stderr, log.LevelInfo, true)))
```
See more about reasoning here: https://github.com/ethereum/go-ethereum/issues/28558#issuecomment-1820606613
2023-11-29 08:33:50 +01:00
..
v4wire all: use rlp.DecodeBytes instead of rlp.Decode where possible (#27994) 2023-08-24 11:47:42 +03:00
v5wire p2p/discover: concurrent TALKREQ handling (#27112) 2023-04-28 11:03:43 +02:00
common.go p2p/discover: add Table configuration and Nodes method (#27387) 2023-05-31 13:37:10 +02:00
lookup.go p2p: use errors.Is for error comparison (#24882) 2022-06-07 17:27:21 +02:00
metrics.go p2p, p2p/discover: add dial metrics (#27621) 2023-07-06 16:20:31 +02:00
node.go p2p/discover: implement v5.1 wire protocol (#21647) 2020-10-14 12:28:17 +02:00
ntp.go p2p: use slices package for sorting (#27494) 2023-06-19 07:48:12 +02:00
table_test.go p2p/discover: add Table configuration and Nodes method (#27387) 2023-05-31 13:37:10 +02:00
table_util_test.go all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
table.go p2p/discover: filter bootnodes by netrestrict (#27701) 2023-07-12 12:01:38 +02:00
v4_lookup_test.go all: update golang/x/ext and fix slice sorting fallout (#27909) 2023-08-12 00:04:12 +02:00
v4_udp_test.go all: replace log15 with slog (#28187) 2023-11-29 08:33:50 +01:00
v4_udp.go p2p, p2p/discover: add dial metrics (#27621) 2023-07-06 16:20:31 +02:00
v5_talk.go p2p/discover: concurrent TALKREQ handling (#27112) 2023-04-28 11:03:43 +02:00
v5_udp_test.go all: replace log15 with slog (#28187) 2023-11-29 08:33:50 +01:00
v5_udp.go p2p, p2p/discover: add dial metrics (#27621) 2023-07-06 16:20:31 +02:00