From 39b2a3b5037f16aa8f0f7c9cdb09134f0f2ad1e8 Mon Sep 17 00:00:00 2001 From: m1sk9 Date: Thu, 12 Oct 2023 00:43:23 +0900 Subject: [PATCH] refactor: move to logging logic --- src/config.rs | 1 - src/main.rs | 4 +++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/config.rs b/src/config.rs index 6b2ee4d..55e36f7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -29,7 +29,6 @@ pub fn load_config() -> anyhow::Result { panic!("No reactions found in config file"); } - info!("Loaded config: {:?}", config.reactions); Ok(config) } diff --git a/src/main.rs b/src/main.rs index e69f95e..dbe697c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ use crate::client::discord::create_discord_client; use crate::config::{load_config, IdeaReactionEnv, ENV_CONFIG}; use dotenvy::dotenv; use std::env; +use tracing::info; mod client; mod config; @@ -18,7 +19,8 @@ async fn main() -> anyhow::Result<()> { let mut client = create_discord_client(&ENV_CONFIG.get().unwrap().discord_api_token).await?; - load_config()?; + let config = load_config()?; + info!("Loaded config: {:?}", config.reactions); if let Err(why) = client.start().await { println!("Failed run discord client: {:?}", why);