diff --git a/.cargo/config.toml b/.cargo/config.toml index 27ec85c3..5b8b4a04 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -4,8 +4,6 @@ linker = "/usr/bin/clang-16" rustflags = [ "-C", "link-arg=--ld-path=/usr/bin/mold", - "--cfg", - "tokio_unstable", ] [profile.dev] @@ -14,4 +12,3 @@ strip = "debuginfo" [env] RUST_LOG = "hyper=warn,git_url_parse=warn,debug" -RUSTFLAGS = "--cfg tokio_unstable" diff --git a/Cargo.toml b/Cargo.toml index 1026ca8f..60c52587 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,6 @@ git-next-file-watcher-actor = { path = "crates/file-watcher-actor", version = "0 clap = { version = "4.5", features = ["cargo", "derive"] } # logging -console-subscriber = "0.3" tracing = "0.1" tracing-subscriber = "0.3" diff --git a/crates/cli/Cargo.toml b/crates/cli/Cargo.toml index a42d39fc..01096a18 100644 --- a/crates/cli/Cargo.toml +++ b/crates/cli/Cargo.toml @@ -29,7 +29,6 @@ clap = { workspace = true } kxio = { workspace = true } # logging -console-subscriber = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true } diff --git a/crates/cli/src/server/mod.rs b/crates/cli/src/server/mod.rs index e6cf458f..24ef09f9 100644 --- a/crates/cli/src/server/mod.rs +++ b/crates/cli/src/server/mod.rs @@ -11,7 +11,7 @@ use actor::ServerActor; use git_next_core::git::RepositoryFactory; use kxio::{fs::FileSystem, network::Network}; -use tracing::{info, level_filters::LevelFilter}; +use tracing::info; use std::path::PathBuf; @@ -68,20 +68,16 @@ pub fn start( } pub fn init_logging() { - use tracing_subscriber::prelude::*; - use tracing_subscriber::EnvFilter; + use tracing::Level; + use tracing_subscriber::FmtSubscriber; - let subscriber = tracing_subscriber::fmt::layer() + let subscriber = FmtSubscriber::builder() .with_target(false) .with_file(true) .with_line_number(true) - .with_filter( - EnvFilter::builder() - .with_default_directive(LevelFilter::INFO.into()) - .from_env_lossy(), - ); - tracing_subscriber::registry() - .with(console_subscriber::ConsoleLayer::builder().spawn()) - .with(subscriber) - .init(); + .with_max_level(Level::INFO) + .finish(); + + #[allow(clippy::expect_used)] + tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed"); } diff --git a/crates/core/Cargo.toml b/crates/core/Cargo.toml index e380d950..005669d4 100644 --- a/crates/core/Cargo.toml +++ b/crates/core/Cargo.toml @@ -13,7 +13,6 @@ github = [] [dependencies] # logging -console-subscriber = { workspace = true } tracing = { workspace = true } tracing-subscriber = { workspace = true }