mirror of
https://github.com/YGGverse/aquatic-crawler.git
synced 2026-03-31 17:15:35 +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"
|
log = "0.4"
|
||||||
regex = "1.11"
|
regex = "1.11"
|
||||||
tokio = { version = "1.45", features = ["full"] }
|
tokio = { version = "1.45", features = ["full"] }
|
||||||
tracing-subscriber = "0.3"
|
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||||
url = "2.5"
|
url = "2.5"
|
||||||
urlencoding = "2.1"
|
urlencoding = "2.1"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,14 +17,14 @@ async fn main() -> Result<()> {
|
||||||
use tokio::time;
|
use tokio::time;
|
||||||
// debug
|
// debug
|
||||||
if std::env::var("RUST_LOG").is_ok() {
|
if std::env::var("RUST_LOG").is_ok() {
|
||||||
use tracing_subscriber::fmt::*;
|
use tracing_subscriber::{EnvFilter, fmt::*};
|
||||||
struct T;
|
struct T;
|
||||||
impl time::FormatTime for T {
|
impl time::FormatTime for T {
|
||||||
fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result {
|
fn format_time(&self, w: &mut format::Writer<'_>) -> std::fmt::Result {
|
||||||
write!(w, "{}", Local::now())
|
write!(w, "{}", Local::now())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fmt().with_timer(T).init()
|
fmt().with_timer(T).with_env_filter(EnvFilter::from_default_env()).init()
|
||||||
}
|
}
|
||||||
// init components
|
// init components
|
||||||
let time_init = Local::now();
|
let time_init = Local::now();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue