mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-12 09:51:36 +00:00
Updates the Handle path to perform a single atomic load and no locking. This is done by storing all state required for level matching into a single struct and replacing that struct entirely whenever patterns or the global level change. Also fixes an issue with the current implementation where WithAttrs would return a fully independent copy of the handler, with its own level. The WithAttrs method is calledd by slog.Logger.With, which we also use in go-ethereum to create context specific loggers with pre-filled attributes. Under the previous implementation of WithAttrs, if the application created a long-lived logger (for example, for a specific peer), then that logger would not be affected by later level changes done on the top-level logger, leading to potentially missed events. |
||
|---|---|---|
| .. | ||
| format.go | ||
| format_test.go | ||
| handler.go | ||
| handler_glog.go | ||
| logger.go | ||
| logger_test.go | ||
| root.go | ||
| root_test.go | ||