mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 09:05:33 +00:00
use env-filter feature
This commit is contained in:
parent
dd73040dba
commit
569c86008e
2 changed files with 3 additions and 3 deletions
|
|
@ -19,7 +19,7 @@ librqbit = {version = "9.0.0-beta.1", features = ["disable-upload"]}
|
|||
log = "0.4"
|
||||
regex = "1.11"
|
||||
tokio = { version = "1.45", features = ["full"] }
|
||||
tracing-subscriber = "0.3"
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
url = "2.5"
|
||||
urlencoding = "2.1"
|
||||
|
||||
|
|
|
|||
|
|
@ -17,14 +17,14 @@ async fn main() -> Result<()> {
|
|||
use tokio::time;
|
||||
// debug
|
||||
if std::env::var("RUST_LOG").is_ok() {
|
||||
use tracing_subscriber::fmt::*;
|
||||
use tracing_subscriber::{EnvFilter, fmt::*};
|
||||
struct T;
|
||||
impl time::FormatTime for T {
|
||||
fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result {
|
||||
write!(w, "{}", Local::now())
|
||||
}
|
||||
}
|
||||
fmt().with_timer(T).init()
|
||||
fmt().with_timer(T).with_env_filter(EnvFilter::from_default_env()).init()
|
||||
}
|
||||
// init components
|
||||
let time_init = Local::now();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue