-
Notifications
You must be signed in to change notification settings - Fork 159
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
Global async logging #232
Global async logging #232
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.
Sooooo much cleaner
forest/src/logger/mod.rs
Outdated
.filter(None, log::LevelFilter::Trace) | ||
.build(); | ||
async_log::Logger::wrap(logger, || 0) | ||
.start(log::LevelFilter::Trace) |
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.
Info should probably be default?
.start(log::LevelFilter::Trace) | |
.start(log::LevelFilter::Info) |
// SPDX-License-Identifier: Apache-2.0, MIT | ||
|
||
pub(crate) fn setup_logger() { | ||
let logger = pretty_env_logger::formatted_timed_builder() |
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.
Also, thoughts on changing the timestamp format
2020-02-18T19:35:07.045
to something like
2020-02-18 19:35:07
Nit, but the timestamp is a lot to look at right now lol. Can change in another PR or something, this may just be me
I've good experience with https://crates.io/crates/flexi_logger. There is also https://github.com/filecoin-project/rust-fil-logger which is used for the filecoin proofs stuff that has a flag to create JSON output that is compatible to the one Lotus is using. |
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.
fine to leave default logging level as trace for now if you want (although annoying to read through trace logs inside libp2p) and opened issue with: #237
Summary of changes
Changes introduced in this pull request:
Reference issue to close (if applicable)
Closes
Other information and links