From 0ce0257fdc9b1992b438c379a4a442b627fcfeee Mon Sep 17 00:00:00 2001 From: Xevion Date: Wed, 28 Jan 2026 20:13:53 -0600 Subject: [PATCH] chore: reduce tracing verbosity and normalize log levels --- src/banner/api.rs | 7 ++----- src/banner/middleware.rs | 3 --- src/scraper/jobs/subject.rs | 4 ++-- src/scraper/worker.rs | 4 ++-- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/banner/api.rs b/src/banner/api.rs index 04ce5cf..173f19a 100644 --- a/src/banner/api.rs +++ b/src/banner/api.rs @@ -142,11 +142,8 @@ impl BannerApi { /// Performs a course search and handles common response processing. #[tracing::instrument( - skip(self, query), - fields( - term = %term, - subject = %query.get_subject().unwrap_or(&"all".to_string()) - ) + skip(self, query, sort, sort_descending), + fields(term = %term) )] async fn perform_search( &self, diff --git a/src/banner/middleware.rs b/src/banner/middleware.rs index 108743f..5e836fd 100644 --- a/src/banner/middleware.rs +++ b/src/banner/middleware.rs @@ -48,11 +48,9 @@ impl Middleware for TransparentMiddleware { } Ok(response) } else { - let e = response.error_for_status_ref().unwrap_err(); warn!( method = method, path = path, - error = ?e, status = response.status().as_u16(), duration_ms = duration.as_millis(), "Request failed" @@ -64,7 +62,6 @@ impl Middleware for TransparentMiddleware { warn!( method = method, path = path, - error = ?error, duration_ms = duration.as_millis(), "Request failed" ); diff --git a/src/scraper/jobs/subject.rs b/src/scraper/jobs/subject.rs index e0d1a2f..d4f079c 100644 --- a/src/scraper/jobs/subject.rs +++ b/src/scraper/jobs/subject.rs @@ -39,14 +39,14 @@ impl Job for SubjectJob { if let Some(courses_from_api) = search_result.data { info!( - subject = subject_code, + subject = %subject_code, count = courses_from_api.len(), "Found courses" ); batch_upsert_courses(&courses_from_api, db_pool).await?; } - debug!(subject = subject_code, "Subject job completed"); + debug!(subject = %subject_code, "Subject job completed"); Ok(()) } diff --git a/src/scraper/worker.rs b/src/scraper/worker.rs index fefa787..94b41e0 100644 --- a/src/scraper/worker.rs +++ b/src/scraper/worker.rs @@ -96,7 +96,7 @@ impl Worker { let job_impl = job_type.boxed(); // Create span with job context - let span = tracing::debug_span!( + let span = tracing::info_span!( "process_job", job_id = job.id, job_type = job_impl.description() @@ -234,7 +234,7 @@ impl Worker { // Atomically unlock and increment retry count, checking if retry is allowed match self.unlock_and_increment_retry(job_id, max_retries).await { Ok(can_retry) if can_retry => { - info!( + debug!( worker_id = self.id, job_id, retry_attempt = next_attempt,