Skip to content

Conversation

@kamilsa
Copy link
Contributor

@kamilsa kamilsa commented Dec 24, 2025

Improved more readable logs:

image

Copilot AI review requested due to automatic review settings December 24, 2025 15:17
Copy link
Contributor

Copilot AI left a 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 --log flag
  • 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.

@kamilsa kamilsa requested review from turuslan and xDimon January 8, 2026 09:58
@kamilsa kamilsa enabled auto-merge (squash) January 8, 2026 09:58
Comment on lines 121 to 125
std::cerr
<< "+===============================================================+\n"
<< fmt::format(" CHAIN STATUS: Current Slot: {} | Head Slot: {} \n",
msg->slot,
head.slot)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May use println

Suggested change
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,
Copy link
Member

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?

@kamilsa kamilsa merged commit 3937242 into master Jan 12, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants