Skip to content

Commit

Permalink
fix: make log level configurable and change default to INFO
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreiffers committed Nov 15, 2023
1 parent 8457e5b commit c350aed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/bin/fdk-mqa-scoring-service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ use futures::{
FutureExt,
};

lazy_static! {
pub static ref LOG_LEVEL: String = env::var("LOG_LEVEL").unwrap_or("INFO".to_string());
}

#[get("/ping")]
async fn ping() -> impl Responder {
"pong"
Expand All @@ -36,7 +40,7 @@ async fn metrics() -> impl Responder {
async fn main() {
tracing_subscriber::fmt()
.json()
.with_max_level(tracing::Level::DEBUG)
.with_max_level(tracing::Level::from_str(&env_log_level).unwrap())

Check failure on line 43 in src/bin/fdk-mqa-scoring-service.rs

View workflow job for this annotation

GitHub Actions / Run tests when pull request is created / Run tests

cannot find value `env_log_level` in this scope

Check failure on line 43 in src/bin/fdk-mqa-scoring-service.rs

View workflow job for this annotation

GitHub Actions / Run tests when pull request is created / Run tests

no function or associated item named `from_str` found for struct `tracing::Level` in the current scope
.with_target(false)
.with_current_span(false)
.init();
Expand Down

0 comments on commit c350aed

Please sign in to comment.