diff options
Diffstat (limited to 'src/commands/game.rs')
| -rw-r--r-- | src/commands/game.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/commands/game.rs b/src/commands/game.rs index ba9ac69..258feaf 100644 --- a/src/commands/game.rs +++ b/src/commands/game.rs @@ -17,13 +17,9 @@ use fnv::{ FnvHashMap, FnvHashSet, }; +use grate::tracing; use itertools::Itertools; use lazy_static::lazy_static; -use log::{ - debug, - error, - info, -}; use serde::Deserialize; use serenity::model::{ guild::Guild, @@ -86,7 +82,7 @@ lazy_static! { }) .collect::<FnvHashMap<_, _>>(); - info!( + tracing::info!( "loaded user info for {} users ({:#?})", result.len(), result.keys().collect::<Vec<_>>() @@ -248,14 +244,14 @@ async fn _game( let Ok(guild) = guild.guild(&ctx).ok_or_else(|| anyhow!("couldn't find guild")) else { - error!("failed retrieving guild"); + tracing::error!("failed retrieving guild"); return None; }; get_user_id(guild.borrow(), &u) }; - debug!("parsed userid {:?}", possible); + tracing::debug!("parsed userid {:?}", possible); match possible { Ok(x) => Some(x), @@ -276,7 +272,7 @@ async fn _game( let res = DISCORD_MAP.get(&uid).map(|s| s.to_lowercase()); if res.is_none() { - info!("user {uid} is not recognized"); + tracing::info!("user {uid} is not recognized"); } res @@ -314,7 +310,7 @@ async fn _game( let inferred = users.is_empty(); if inferred && users.len() < 2 || !inferred && users.is_empty() { - info!("too few known users to make game comparison"); + tracing::info!("too few known users to make game comparison"); util::reply(ctx, "yer too lonely").await?; return Ok(()); } @@ -458,7 +454,7 @@ pub async fn updategaem(ctx: PoiseContext<'_>, user: Option<String>) -> anyhow:: }, }; - debug!("parsed userid {:?}", user); + tracing::debug!("parsed userid {:?}", user); let username = match DISCORD_MAP.get(&user) { Some(s) => s, @@ -498,7 +494,7 @@ pub async fn updategaem(ctx: PoiseContext<'_>, user: Option<String>) -> anyhow:: let appid_column = match appid_column { Some(c) => &spreadsheet[c][1..], None => { - error!("didn't find an appid column in the spreadsheet"); + tracing::error!("didn't find an appid column in the spreadsheet"); util::reply(ctx, "SPREADSHEET BROKE").await?; return Ok(()); }, @@ -555,7 +551,7 @@ pub async fn updategaem(ctx: PoiseContext<'_>, user: Option<String>) -> anyhow:: let games_owned = games_owned.response.games.into_iter().map(|ge| ge.app_id).collect::<FnvHashSet<_>>(); - debug!("user owns {} steam games", games_owned.len()); + tracing::debug!("user owns {} steam games", games_owned.len()); let found_games = missing_appids .filter_map(|(ai, x)| { |
