Skip to content

Commit

Permalink
use tracing instead of prima_rs_logger
Browse files Browse the repository at this point in the history
  • Loading branch information
cpiemontese committed Jun 19, 2024
1 parent 688aaa6 commit b8bed99
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 227 deletions.
226 changes: 13 additions & 213 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ uuid = {version = "1.1.2", features = ["v4"]}

toml = "0.5.9"

prima_rs_logger = "0.1"
tracing = { version = "0.1", features = ["log", "max_level_info", "release_max_level_info"] }

futures = "0.3.21"
reqwest = { version = "0.11.24", default-features = false, features = ["native-tls"] }
Expand Down
7 changes: 3 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use std::fs;

use chrono::{DateTime, Utc};
use derive_getters::Getters;
use prima_rs_logger::{error, warn};
use serde::Deserialize;

use thiserror::Error;
Expand Down Expand Up @@ -67,10 +66,10 @@ impl Config {
Self::load()
.map_err(|e| match e {
Error::TomlError(error) => {
error!("Config not parsable: {}", error);
tracing::error!("Config not parsable: {}", error);
}
Error::ReadFileError(error) => {
error!("Failed to read config file: {}", error);
tracing::error!("Failed to read config file: {}", error);
}
})
.unwrap_or_default()
Expand All @@ -81,7 +80,7 @@ impl Config {
let config_file_path = std::env::var_os("LOCALAUTH0_CONFIG_PATH");

if config_file_path.is_some() && config_from_env.is_some() {
warn!("Both LOCALAUTH0_CONFIG_PATH and LOCALAUTH0_CONFIG are set. Using to LOCALAUTH0_CONFIG");
tracing::warn!("Both LOCALAUTH0_CONFIG_PATH and LOCALAUTH0_CONFIG are set. Using to LOCALAUTH0_CONFIG");
}

let cfg = if let Some(config_env) = config_from_env {
Expand Down
Loading

0 comments on commit b8bed99

Please sign in to comment.