diff --git a/crates/robbb/src/attachment_logging.rs b/crates/robbb/src/attachment_logging.rs index fc46ccfa..5f19b62c 100644 --- a/crates/robbb/src/attachment_logging.rs +++ b/crates/robbb/src/attachment_logging.rs @@ -40,7 +40,7 @@ pub async fn store_attachments( /// Store a single attachment in the given directory path. async fn store_single_attachment(dir_path: impl AsRef, attachment: Attachment) -> Result<()> { let file_path = dir_path.as_ref().join(attachment.filename); - tracing::debug!("Storing file {}", &file_path.display()); + tracing::debug!(file_path = %file_path.display(), "Storing file {}", &file_path.display()); let resp = reqwest::get(&attachment.url).await.context("Failed to load attachment")?; let mut body = resp @@ -104,10 +104,11 @@ pub async fn cleanup(config: &Config) -> Result<()> { files.sort_by_key(|(_, meta)| meta.modified().expect("Unsupported platform")); } - tracing::info!("{} bytes currently occupied by attachment logging", total_size_bytes); + tracing::info!(attachment_logs.total_size_bytes = %total_size_bytes, "Performing attachment cleanup"); while total_size_bytes > config.attachment_cache_max_size && !files.is_empty() { let (file, meta) = files.remove(0); + tracing::trace!(file_name = %file.path().display(), size = meta.size(), "Deleting file"); tokio::fs::remove_file(file.path()) .instrument(tracing::info_span!("Deleting file", file_name = %file.path().display(), size = meta.size())) .await?; diff --git a/crates/robbb/src/events/guild_member_update.rs b/crates/robbb/src/events/guild_member_update.rs index 4f7fef5d..82f91118 100644 --- a/crates/robbb/src/events/guild_member_update.rs +++ b/crates/robbb/src/events/guild_member_update.rs @@ -25,6 +25,7 @@ pub async fn dehoist_member(ctx: client::Context, member: Member) -> Result<()> } else { cleaned_name.to_string() }; + tracing::info!(user.old_name = %display_name, user.cleaned_name = %cleaned_name, "Dehoisting user"); member .edit(&ctx, |edit| edit.nickname(&cleaned_name)) .instrument(tracing::info_span!("dehoist-edit-nickname", member.tag = %member.user.tag(), dehoist.old_nick = %display_name, dehoist.new_nick = %cleaned_name)) diff --git a/crates/robbb/src/events/ready.rs b/crates/robbb/src/events/ready.rs index c949b543..3416cc22 100644 --- a/crates/robbb/src/events/ready.rs +++ b/crates/robbb/src/events/ready.rs @@ -8,7 +8,7 @@ pub async fn ready(ctx: client::Context, _data_about_bot: Ready) -> Result<()> { let config = ctx.get_config().await; let bot_version = util::bot_version(); - tracing::info!("Robbb is ready! Running version {}", &bot_version); + tracing::info!(robbb_version = %bot_version, "Robbb is ready! Running version {}", &bot_version); let _ = config .channel_mod_bot_stuff