Logs: separate new head infos event with different verbosity
Context
now that !7603 (merged) is merged we can proceed cleaning up stdout
fixes #4581 (closed)
This MR set separates events advertizing of new heads in two parts with different level of verbosity:
-
branch_switch
,head_increment
andignore_head
are stripped fromtimestamp
andfitness
and kept at levelNotice
- a new event
head_infos
, of levelInfo
contains thefitness
and thetimestamp
Only the hash and the level are kept. The formatting is also changed to stay on one line. Hence User logs are changed in the following way:
Before
Feb 13 18:37:59.487 - validator.chain: Update current head to BLktX5fQNXbCvGV1UkHeszKhjQUUQRCXeXCadgsUHtL8jNYP6HE
Feb 13 18:37:59.487 - validator.chain: (level 676530, timestamp 2023-02-13T17:37:50-00:00, fitness
Feb 13 18:37:59.487 - validator.chain: 02::000a52b2::::ffffffff::00000000), same branch
After
Feb 13 18:31:05.538 - validator.chain: head is now BMHTe7MRFUks7dTbs3cfXpwu58gxuKEEHExLj6xjwL1oYHP8fZ3 (676503)
and Internal logs now have the following shape:
2023-02-13T17:34:35.700-00:00 [validator.chain.head_increment] head is now BLi1enjMNjRKj5hHm8U2ortppnUZX
9QdKWfqpV93SzPdZyMtUt3 (676517)
2023-02-13T17:34:35.700-00:00 [validator.chain.head_infos] treated block has timestamp 2023-02-13T17:3
4:35-00:00 with fitness 02::000a52a5::::ffffffff::00000000)
Manually testing the MR
Checklist
-
Document the interface of any function added or modified (see the coding guidelines) -
Document any change to the user interface, including configuration parameters (see node configuration) -
Provide automatic testing (see the testing guide). -
For new features and bug fixes, add an item in the appropriate changelog ( docs/protocols/alpha.rst
for the protocol and the environment,CHANGES.rst
at the root of the repository for everything else). -
Select suitable reviewers using the Reviewers
field below. -
Select as Assignee
the next person who should take action on that MR
Edited by Rémy El Sibaïe