Skip to content

Commit

Permalink
don't include these logs
Browse files Browse the repository at this point in the history
  • Loading branch information
dmarticus committed Jan 24, 2025
1 parent f3da199 commit 44c94d4
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions rust/feature-flags/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,33 +126,17 @@ impl Config {
}

pub fn get_maxmind_db_path(&self) -> PathBuf {
let path = if self.maxmind_db_path.is_empty() {
let manifest_dir = env!("CARGO_MANIFEST_DIR");
let default_path = Path::new(manifest_dir)
if self.maxmind_db_path.is_empty() {
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.parent()
.unwrap()
.join("share")
.join("GeoLite2-City.mmdb");

tracing::info!(
"No custom maxmind_db_path set. Using default path: {:?}",
default_path
);
default_path
.join("GeoLite2-City.mmdb")
} else {
let custom_path = PathBuf::from(&self.maxmind_db_path);
tracing::info!("Using custom maxmind_db_path: {:?}", custom_path);
custom_path
};

tracing::info!("Checking if path exists: {:?}", path);
if !path.exists() {
tracing::error!("GeoIP database file not found at: {:?}", path);
PathBuf::from(&self.maxmind_db_path)
}

path
}
}

Expand Down

0 comments on commit 44c94d4

Please sign in to comment.