go-ethereum/p2p
Daniel Liu 14acdf2dd1 log: remove lazy, remove unused interfaces, unexport methods (#28622)
This change

- Removes interface `log.Format`,
- Removes method `log.FormatFunc`,
- unexports `TerminalHandler.TerminalFormat` formatting methods (renamed to `TerminalHandler.format`)
- removes the notion of `log.Lazy` values

The lazy handler was useful in the old log package, since it
could defer the evaluation of costly attributes until later in the
log pipeline: thus, if the logging was done at 'Trace', we could
skip evaluation if logging only was set to 'Info'.

With the move to slog, this way of deferring evaluation is no longer
needed, since slog introduced 'Enabled': the caller can thus do
the evaluate-or-not decision at the callsite, which is much more
straight-forward than dealing with lazy reflect-based evaluation.

Also, lazy evaluation would not work with 'native' slog, as in, these
two statements would be evaluated differently:

```golang
  log.Info("foo", "my lazy", lazyObj)
  slog.Info("foo", "my lazy", lazyObj)
```
2024-11-15 10:02:42 +08:00
..
discover log: remove lazy, remove unused interfaces, unexport methods (#28622) 2024-11-15 10:02:42 +08:00
discv5 log: remove lazy, remove unused interfaces, unexport methods (#28622) 2024-11-15 10:02:42 +08:00
enr Revert EIP-2464 2024-08-24 02:31:27 +07:00
nat Revert EIP-2464 2024-08-24 02:31:27 +07:00
netutil p2p/netutil: fix staticcheck warning SA1021: not use bytes.Equal to compare net.IPs 2024-11-01 11:35:42 +08:00
protocols Revert EIP-2464 2024-08-24 02:31:27 +07:00
simulations all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00
testing all: fix staticcheck warning ST1006: don't use generic name self 2024-10-25 21:30:54 +08:00
dial.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
dial_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
message.go all: fix staticcheck warning ST1006: don't use generic name self 2024-10-25 21:30:54 +08:00
message_test.go all: fix go vet warnings 2016-04-15 11:17:27 +02:00
metrics.go new EVM Upgrade 2021-09-21 16:53:46 +05:30
peer.go rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. (#16333) 2024-11-13 09:33:18 +08:00
peer_error.go all: fix staticcheck warning ST1006: don't use generic name self 2024-10-25 21:30:54 +08:00
peer_test.go p2p: fix staticcheck warning SA4030: rand.Intn(1) always returns 0 2024-11-01 11:32:56 +08:00
protocol.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
rlpx.go p2p: fix staticcheck warning SA4009: overwrite argument before use 2024-11-01 11:34:15 +08:00
rlpx_test.go Revert EIP-2464 2024-08-24 02:31:27 +07:00
server.go rpc: Add admin_addTrustedPeer and admin_removeTrustedPeer. (#16333) 2024-11-13 09:33:18 +08:00
server_test.go all: replace log15 with slog (#28187) 2024-11-15 10:02:42 +08:00