chore: reduce tracing verbosity and normalize log levels

This commit is contained in:
2026-01-28 20:13:53 -06:00
parent fa2fc45aa9
commit 0ce0257fdc
4 changed files with 6 additions and 12 deletions
+2 -5
View File
@@ -142,11 +142,8 @@ impl BannerApi {
/// Performs a course search and handles common response processing. /// Performs a course search and handles common response processing.
#[tracing::instrument( #[tracing::instrument(
skip(self, query), skip(self, query, sort, sort_descending),
fields( fields(term = %term)
term = %term,
subject = %query.get_subject().unwrap_or(&"all".to_string())
)
)] )]
async fn perform_search( async fn perform_search(
&self, &self,
-3
View File
@@ -48,11 +48,9 @@ impl Middleware for TransparentMiddleware {
} }
Ok(response) Ok(response)
} else { } else {
let e = response.error_for_status_ref().unwrap_err();
warn!( warn!(
method = method, method = method,
path = path, path = path,
error = ?e,
status = response.status().as_u16(), status = response.status().as_u16(),
duration_ms = duration.as_millis(), duration_ms = duration.as_millis(),
"Request failed" "Request failed"
@@ -64,7 +62,6 @@ impl Middleware for TransparentMiddleware {
warn!( warn!(
method = method, method = method,
path = path, path = path,
error = ?error,
duration_ms = duration.as_millis(), duration_ms = duration.as_millis(),
"Request failed" "Request failed"
); );
+2 -2
View File
@@ -39,14 +39,14 @@ impl Job for SubjectJob {
if let Some(courses_from_api) = search_result.data { if let Some(courses_from_api) = search_result.data {
info!( info!(
subject = subject_code, subject = %subject_code,
count = courses_from_api.len(), count = courses_from_api.len(),
"Found courses" "Found courses"
); );
batch_upsert_courses(&courses_from_api, db_pool).await?; batch_upsert_courses(&courses_from_api, db_pool).await?;
} }
debug!(subject = subject_code, "Subject job completed"); debug!(subject = %subject_code, "Subject job completed");
Ok(()) Ok(())
} }
+2 -2
View File
@@ -96,7 +96,7 @@ impl Worker {
let job_impl = job_type.boxed(); let job_impl = job_type.boxed();
// Create span with job context // Create span with job context
let span = tracing::debug_span!( let span = tracing::info_span!(
"process_job", "process_job",
job_id = job.id, job_id = job.id,
job_type = job_impl.description() job_type = job_impl.description()
@@ -234,7 +234,7 @@ impl Worker {
// Atomically unlock and increment retry count, checking if retry is allowed // Atomically unlock and increment retry count, checking if retry is allowed
match self.unlock_and_increment_retry(job_id, max_retries).await { match self.unlock_and_increment_retry(job_id, max_retries).await {
Ok(can_retry) if can_retry => { Ok(can_retry) if can_retry => {
info!( debug!(
worker_id = self.id, worker_id = self.id,
job_id, job_id,
retry_attempt = next_attempt, retry_attempt = next_attempt,