Skip to content
This repository has been archived by the owner on Dec 6, 2024. It is now read-only.

Skip engine print in /health #228

Merged
merged 3 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ lazy_static! {
static ref SPAWN_SEMAPHORE: Semaphore = Semaphore::new(PROCESS_SPAWN_LIMIT);
}

#[instrument]
#[instrument(skip(engine))]
#[get("/health")]
pub async fn health(engine: &State<WorkerEngine>) -> HealthCheckResponse {
info!("/health");
Expand Down
2 changes: 1 addition & 1 deletion api/src/handlers/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub async fn verify(
})
}

#[instrument(skip(_rate_limited, engine))]
#[instrument(skip(verification_request_json, _rate_limited, engine))]
#[post("/verify-async", format = "json", data = "<verification_request_json>")]
pub fn verify_async(
verification_request_json: Json<VerificationRequest>,
Expand Down
14 changes: 6 additions & 8 deletions api/src/tracing_log.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
use tracing_appender::rolling;

use tracing_subscriber::field::MakeExt;
use tracing_subscriber::fmt::writer::MakeWriterExt;
use tracing_subscriber::registry::LookupSpan;
use tracing_subscriber::Layer;
use tracing_subscriber::{prelude::*, EnvFilter};

use tracing_subscriber::field::MakeExt;
use yansi::Paint;

use crate::errors::CoreError;
use tracing_subscriber::Layer;
use yansi::Paint;

pub enum LogType {
Formatted,
Expand Down Expand Up @@ -115,7 +113,8 @@ pub fn init_logger() -> Result<(), CoreError> {
let rolling_files = tracing_subscriber::fmt::layer()
.json()
.with_writer(all_files)
.with_ansi(false);
.with_ansi(false)
.with_filter(filter_layer(LogLevel::Debug));

let log_type = LogType::from(std::env::var("LOG_TYPE").unwrap_or_else(|_| "json".to_string()));
let log_level = LogLevel::from(
Expand All @@ -132,8 +131,7 @@ pub fn init_logger() -> Result<(), CoreError> {
)?,
LogType::Json => tracing::subscriber::set_global_default(
tracing_subscriber::registry()
.with(json_logging_layer())
.with(filter_layer(log_level))
.with(json_logging_layer().with_filter(filter_layer(log_level)))
.with(rolling_files),
)?,
};
Expand Down
Loading