Use env var to configure logging
This commit is contained in:
parent
8a56fcf126
commit
22eba91a17
2 changed files with 9 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue