Skip to content
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

chore: print WakuMessageHash as hex strings #2969

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Conversation

richard-ramos
Copy link
Member

Description

Currently message hashes are printed like this:

 topics="waku store" tid=1 file=protocol.nim:58 peerId=16U*BGaw4B requestId=75cbe84cac46075074bcb95cc1920703a7b4bc2aba306959c11085b5379ffef8 request="(requestId: \"75cbe84cac46075074bcb95cc1920703a7b4bc2aba306959c11085b5379ffef8\", includeData: false, pubsubTopic: none(string), contentTopics: @[], startTime: none(CompiledIntTypes), endTime: none(CompiledIntTypes), messageHashes: @[[129, 203, 114, 194, 222, 123, 86, 228, 156, 248, 29, 51, 153, 77, 232, 234, 124, 205, 98, 87, 59, 33, 178, 231, 153, 98, 190, 112, 172, 251, 129, 170], [171, 5, 26, 138, 98, 133, 28, 211, 242, 130, 235, 135, 150, 206, 79, 16, 204, 114, 139, 103, 124, 102, 40, 96, 73, 103, 59, 102, 210, 152, 66, 229], [105, 227, 97, 110, 122, 72, 36, 150, 98, 112, 239, 37, 220, 175, 171, 55, 249, 239, 136, 108, 228, 76, 54, 47, 186, 59, 244, 128, 60, 95, 13, 250], [145, 128, 146, 47, 111, 163, 239, 21, 128, 137, 27, 226, 185, 28, 9, 133, 130, 213, 138, 225, 10, 169, 112, 48, 183, 116, 177, 189, 228, 189, 64, 222], [122, 56, 93, 236, 124, 13, 204, 143, 71, 58, 69, 112, 80, 15, 77, 126, .....

With this change, they would look like this instead:

 topics="waku store" tid=1 file=protocol.nim:58 peerId=16U*BGaw4B requestId=75cbe84cac46075074bcb95cc1920703a7b4bc2aba306959c11085b5379ffef8 request="(requestId: \"75cbe84cac46075074bcb95cc1920703a7b4bc2aba306959c11085b5379ffef8\", includeData: false, pubsubTopic: none(string), contentTopics: @[], startTime: none(CompiledIntTypes), endTime: none(CompiledIntTypes), messageHashes: @[0x0102030405060708090001020304050607080900010203040506070809000102, 0x0202030405060708090001020304050607080900010203040506070809000102, 0x0302030405060708090001020304050607080900010203040506070809000102....

Which makes them easier to read and search in kibana, as well as reduces the length of the log lines

Copy link

github-actions bot commented Aug 13, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2969

Built from 881680b

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Wonderful! Thanks for it! 💯

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

Thank you!

@Ivansete-status Ivansete-status merged commit 2fd4eb6 into master Aug 14, 2024
9 of 11 checks passed
@Ivansete-status Ivansete-status deleted the hash-print-fmt branch August 14, 2024 19:04
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.

3 participants