-
Notifications
You must be signed in to change notification settings - Fork 93
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
Minor follow-ups to #407 #450
Conversation
b8c928a
to
44c4df4
Compare
9b2fddb
to
11161e1
Compare
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 adding this.
I have reviewed and tested. This LGTM.
We slightly improve readability of `setup_logger`, and also clean up some of the `DEFAULT` consts while we're at it.
.. tabs, not spaces. This one seemed to have slipped by `cargo fmt`
Now that we made the `logger` module `pub`, we can drop the type exports at crate level
11161e1
to
b968ea7
Compare
let log_file_path = log_file_path | ||
.clone() | ||
.unwrap_or_else(|| format!("{}/{}", config.storage_dir_path, DEFAULT_LOG_FILENAME)); | ||
let log_level = log_level.unwrap_or_else(|| DEFAULT_LOG_LEVEL); |
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.
I wonder how much we gain from using an or_else
closure for a constant instead of or
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.
Hah, true
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.
I wonder how cargo fmt didn't catch that?
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.
It doesn’t touch macros.
Based on #407 until that is merged.
We add some minor cleanups here.
(cc @enigbe)