From c5ce454319a7d54d3967c6ea7695543e943a37b2 Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Fri, 16 Aug 2024 07:12:33 -0400 Subject: tracing: use fields rather than interpolation --- src/commands/meme/history.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/commands/meme/history.rs') diff --git a/src/commands/meme/history.rs b/src/commands/meme/history.rs index e3d0de3..d6ccdcf 100644 --- a/src/commands/meme/history.rs +++ b/src/commands/meme/history.rs @@ -107,9 +107,10 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option) -> anyhow::Result< if n > CONFIG.max_hist { tracing::debug!( - "user requested more than MAX_HIST ({}) items from history", - CONFIG.max_hist + MAX_HIST = CONFIG.max_hist, + "user requested more than MAX_HIST items from history", ); + util::reply(ctx, "YER PUSHIN ME OVER THE FUCKIN LINE").await?; } @@ -127,7 +128,7 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option) -> anyhow::Result< return Ok(()); } - tracing::info!("reporting meme history (len {})", n); + tracing::info!(len = n, "reporting meme history"); let resp = serenity::futures::stream::iter(records.into_iter().enumerate().rev()) .then(|(i, rec)| async move { @@ -181,7 +182,7 @@ pub async fn history(ctx: PoiseContext<'_>, n: Option) -> anyhow::Result< Err(e) => { if let Some(variant) = e.downcast_ref::() { if *variant != NotFound { - tracing::error!("error encountered loading meme history: {}", e); + tracing::error!(error = %e, "error encountered loading meme history"); } } -- cgit v1.3.1