-
Notifications
You must be signed in to change notification settings - Fork 10
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
Fix/the entry using log #100
Conversation
}}; | ||
|
||
() => {{ | ||
use 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.
maybe import this at top level? otherwise this may be imported every time we log.
Im not sure if compiler optimizes this away though.
}}; | ||
|
||
() => {{ | ||
use 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.
same here.
bls-runtime/src/plog.rs
Outdated
use env_logger::Logger; | ||
use log::{Level, Log, MetadataBuilder, Record}; | ||
|
||
static mut ENV_LOGGER: Option<Logger> = None; |
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.
Lets try not use an option type - but instead use the concrete type directly.
We can use OnceLock
for this.
Example (i'd envision something like this):
static mut ENV_LOGGER: std::sync::OnceLock<Logger> = std::sync::OnceLock::new();
pub fn env_logger() -> &'static mut Logger {
ENV_LOGGER.get_or_init(|| { ... })
}
I see few PRs where we make formatting changes - maybe we should enforce formatting in CI to ensure formatting before we push ( |
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 👍
improve: