-
Notifications
You must be signed in to change notification settings - Fork 3
Enhance logs #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enhance logs #49
Conversation
…ce and networking
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR enhances the logging system throughout the codebase by improving log messages with emojis for better readability, adjusting log levels for more appropriate verbosity, refactoring the logging configuration system to support CLI-based log level overrides, and adding logger support to the State Transition Function (STF).
Key changes:
- Refactored logging configuration to load from a unified default config file and support CLI-based log level overrides via the
--logflag - Added logger to STF and updated all instantiations
- Enhanced log messages with emojis and more detailed context (peer IDs, validator IDs, hex-formatted hashes)
- Adjusted log levels: moved verbose operational logs (slot starts, intervals, vote production) from INFO to DEBUG while keeping important state changes at INFO
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tests/unit/blockchain/state_transition_function_test.cpp |
Updated STF constructor call to include logger parameter |
src/modules/networking/networking.cpp |
Enhanced networking logs with emojis, peer info, and hex hash formatting; moved detailed block receive logs from INFO to DEBUG |
src/log/formatters/block_index_ref.hpp |
Changed default BlockIndexRef formatter to long_form for more detailed output |
src/executable/lean_node.cpp |
Reordered initialization to call step2 before logging setup, enabling CLI log options to be processed before logger configuration |
src/blockchain/state_transition_function.hpp |
Added logger member variable to STF class |
src/blockchain/state_transition_function.cpp |
Updated STF constructor to accept and initialize logger |
src/blockchain/fork_choice.cpp |
Extensive logging enhancements including emojis, validator node IDs, hex-formatted hashes, and adjusted log levels for slot/interval messages |
src/app/impl/timeline_impl.cpp |
Added slot start logging and removed redundant next slot logging |
src/app/impl/chain_spec_impl.cpp |
Removed verbose bootnode addition logging |
src/app/default_logging_yaml.cpp.in |
Removed old template file for logging-only configuration |
src/app/default_config.hpp |
Renamed function from defaultLoggingYaml() to defaultConfigYaml() to reflect broader scope |
src/app/configurator.cpp |
Refactored getLoggingConfig() to support CLI-based log level overrides and load from unified default config |
src/app/CMakeLists.txt |
Updated build to generate default_config.cpp from full config.yaml instead of just logging config |
example/config.yaml |
Added blockchain logging configuration with trace level for fork_choice |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…itional details and emojis
This reverts commit 21d50ff.
Signed-off-by: Dmitriy Khaustov aka xDimon <[email protected]>
src/app/impl/timeline_impl.cpp
Outdated
| std::cerr | ||
| << "+===============================================================+\n" | ||
| << fmt::format(" CHAIN STATUS: Current Slot: {} | Head Slot: {} \n", | ||
| msg->slot, | ||
| head.slot) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May use println
| std::cerr | |
| << "+===============================================================+\n" | |
| << fmt::format(" CHAIN STATUS: Current Slot: {} | Head Slot: {} \n", | |
| msg->slot, | |
| head.slot) | |
| fmt::println(std::cerr, "+===============================================================+"); | |
| fmt::println(std::cerr, " CHAIN STATUS: Current Slot: {} | Head Slot: {}", msg->slot, head.slot); |
| } | ||
|
|
||
| fmt::println( | ||
| std::cerr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about to make special sink and to log that soralog?
Improved more readable logs: