Skip to content

Commit

Permalink
refactor: move to logging logic
Browse files Browse the repository at this point in the history
  • Loading branch information
m1sk9 committed Oct 11, 2023
1 parent 31f0a78 commit 39b2a3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ pub fn load_config() -> anyhow::Result<IdeaReactionConfig> {
panic!("No reactions found in config file");
}

info!("Loaded config: {:?}", config.reactions);
Ok(config)
}

Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 39b2a3b

Please sign in to comment.