-
Notifications
You must be signed in to change notification settings - Fork 978
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: introduce libp2p-logging
#5725
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks for this.
Overall looks good to me, left some minor comments. We also need CHANGELOG.md
entries.
I think when Thomas mentioned the publish = false
wasn't accounting what he said later on #4992 (comment)
Which ones do you suggest? Since the logging is only used in testing part and is not the part of public API, I don't think it needs |
the ones we publish, |
added |
@jxs would appreciate your further review here :) |
|
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.
LGTM, thanks Krishang, thanks for the ping!
Giving more thought about this one taking into account we'll have to release it and be yet another crate to maintain in exchange for duplicating a couple lines across the repo it's not clear its value, but I am willing to move forward, wdyt @elenaf9 @dariusc93 @guillaumemichel @drHuangMHT
yeah, that's why I was suggesting to keep the Majority of the usage of this is in the tests, so no need to publish it. |
but then we still need to have duplicated log initialization code on the published crates ( |
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.
yeah, that's why I was suggesting to keep the publish = false and remove its usage from the packages that are released.
Majority of the usage of this is in the tests, so no need to publish it.
I am also leaning towards not publishing libp2p-logging
, and instead duplicating the lines in the two published crates.
It's not ideal, but it still:
- avoids the verbose
let _ = tracing_subscriber::fmt()...
in all other tests/ examples - doesn't require us to maintain yet another published crate.
yep, I do agree on this, it's better to have 2-3 lines of duplicated code rather than maintaining a whole crate. I have reverted back the changes on the published crates and made |
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.
Thanks for the follow-up @kamuik16!
I just noticed that the new libp2p_logging
crate is not used by any crates in examples/
. Was that on purpose / is there a reason why it can't be used there?
yeah, that was on purpose, examples are meant for user to copy paste and run. If we don't publish the crate, examples would compile in our repository but users who are still new and just want to copy paste and run them, won't be able to do so. does this make sense? |
Description
Fixes #4992
Based on the conversation in #4992.
Change checklist