mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-02-11 05:25:20 -05:00
**What does this PR do? Why is it needed?** This PR, in an attempt to fix the logging issue described in #16314, does the following: - Adds a new field `Identifier` to the `WriterHook` struct, and filters out log entries that have the key `log_target` and the value of the hook's `Identifier`. For now the identifiers are `ephemeral` and `user`, differentiating between the user facing terminal/log file, and the debugger facing ephemeral log file. - Stores the value of the `--verbosity` and `--log.vmodule` flags in `io/logs`, so it can be accessed by packages that need to know the verbosity they're logging with. (note that since #16272 each package can have a different verbosity, so verbosity is now defined per package instead of globally) - Improves the calculation of the global logging level by ignoring the `ephemeralLogFileVerbosity` when the `--disable-ephemeral-log-file` flag is enabled. - Uses these added logic to fix the problem in `logStateTransitionData()` (described in #16314) Note: since we're saving this new data in `io/logs`, we should refactor `prefixFormatter` to read the data from here. but that creates a circular import error. I will try to fix this and refactor the formatter in a future PR. --------- Co-authored-by: Manu NALEPA <enalepa@offchainlabs.com>