diff --git a/Cargo.toml b/Cargo.toml index 236fe81..3bdcc68 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,12 +8,15 @@ anyhow = "1.0.69" parking_lot = "0.12.1" poise = "0.5.2" tracing = "0.1.37" -tracing-subscriber = "0.3.16" tracing-futures = "0.2.5" openai = "1.0.0-alpha.6" rand = "0.8.5" thiserror = "1.0.39" +[dependencies.tracing-subscriber] +version = "0.3.16" +features = ["fmt", "env-filter", "std"] + [dependencies.songbird] version = "0.3.1" features = ["yt-dlp"] diff --git a/src/main.rs b/src/main.rs index 7a0e67d..e1640a3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,6 +5,7 @@ mod personality; mod queue; use commands::*; +use tracing_subscriber::{fmt, prelude::*, EnvFilter}; use std::{env, sync::Arc}; @@ -42,7 +43,10 @@ async fn register(ctx: CommandContext<'_>) -> Result<(), Error> { #[tokio::main] async fn main() -> Result<()> { - tracing_subscriber::fmt().init(); + tracing_subscriber::registry() + .with(fmt::layer()) + .with(EnvFilter::from_default_env()) + .init(); let token = env::var("DISCORD_TOKEN").expect("Expected a bot token in the environment: DISCORD_TOKEN");