From 06a47d3b6a4e798e53f8e1859a432687e896479b Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Sun, 1 Sep 2024 15:49:02 +0100 Subject: [PATCH] Set custom target for ConformU logs --- src/lib.rs | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 730ce01..58cac3c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -586,13 +586,22 @@ mod test_utils { let Some(outcome) = split_with_whitespace(&mut line, 6) else { return false; }; + match outcome { - "OK" => tracing::trace!(?http_method, ?method, ?outcome, "[ConformU] {line}"), - "INFO" => tracing::info!(?http_method, ?method, ?outcome, "[ConformU] {line}"), - "WARN" => tracing::warn!(?http_method, ?method, ?outcome, "[ConformU] {line}"), - "DEBUG" | "" => tracing::debug!(?http_method, ?method, ?outcome, "[ConformU] {line}"), + "OK" => { + tracing::trace!(target: "ascom_alpaca::conformu", ?http_method, ?method, ?outcome, "{line}"); + } + "INFO" => { + tracing::info!(target: "ascom_alpaca::conformu", ?http_method, ?method, ?outcome, "{line}"); + } + "WARN" => { + tracing::warn!(target: "ascom_alpaca::conformu", ?http_method, ?method, ?outcome, "{line}"); + } + "DEBUG" | "" => { + tracing::debug!(target: "ascom_alpaca::conformu", ?http_method, ?method, ?outcome, "{line}"); + } "ISSUE" | "ERROR" => { - tracing::error!(?http_method, ?method, ?outcome, "[ConformU] {line}"); + tracing::error!(target: "ascom_alpaca::conformu", ?http_method, ?method, ?outcome, "{line}"); } _ => return false, }