No longer use the log
crate in the light client
#1560
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Close #756
This PR removes usage of the
log
crate from the light client and instead adds a new function on thePlatformRef
trait.The
DefaultPlatform
uses thelog
crate, which means that the behavior actually doesn't change compared to before.This PR is however a breaking change as it modifies the
PlatformRef
trait. See the changes tolight-base/src/platform/default.rs
to see how to migrate. cc @skunert @ermalkaleci @lexnv as a heads up.I'm doing this for two reasons:
kv_unstable
feature of thelog
crate has been there for, I don't know, years? and still is nowhere near stabilization.log
crate (there's a reason why global variables are considered as a bad thing).An alternative could have been to use the
tracing
crate, but I generally really dislike thetracing
crate due to being over-engineered and confusing. It shouldn't take ten of hours of learning in order to print a log message.As part of this refactoring, I've rewritten all the log messages. Since logs are mostly for bug reports, this should be completely fine. I think and I hope that nobody was parsing log message programatically.