Skip to content

Commit d4aa047

Browse files
committed
debug settings dir
1 parent 13eee7a commit d4aa047

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

services/src/bin/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ use tracing_subscriber::EnvFilter;
1414
use tracing_subscriber::Layer;
1515

1616
#[tokio::main]
17+
#[allow(clippy::dbg_macro)]
1718
async fn main() {
19+
dbg!(std::env::var("GEOENGINE_SETTINGS_FILE_PATH").unwrap());
1820
start_server().await.unwrap();
1921
}
2022

services/src/util/config.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ static SETTINGS: OnceLock<RwLock<Config>> = OnceLock::new();
1818
const SETTINGS_FILE_PATH_OVERRIDE_ENV_VAR: &str = "GEOENGINE_SETTINGS_FILE_PATH";
1919

2020
// TODO: change to `LazyLock' once stable
21+
#[allow(clippy::dbg_macro)]
2122
fn init_settings() -> RwLock<Config> {
2223
let mut settings = Config::builder();
2324

@@ -29,16 +30,22 @@ fn init_settings() -> RwLock<Config> {
2930
settings = settings.add_source(File::from_str(default_settings, FileFormat::Toml));
3031

3132
if let Ok(settings_file_path) = std::env::var(SETTINGS_FILE_PATH_OVERRIDE_ENV_VAR) {
33+
dbg!(
34+
"Settings file path: {} (set by environment variable)",
35+
&settings_file_path
36+
);
3237
// override the settings file path
3338
settings = settings.add_source(File::with_name(&settings_file_path));
3439
} else {
3540
// use the default settings file path
3641
#[cfg(test)]
3742
{
43+
dbg!("Settings file path: Settings-test.toml");
3844
settings = settings.add_source(File::from(dir.join("Settings-test.toml")));
3945
}
4046
#[cfg(not(test))]
4147
{
48+
dbg!("Settings file path: Settings.toml");
4249
settings = settings.add_source(File::from(dir.join("Settings.toml")));
4350
}
4451
}

services/tests/startup.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ impl Drop for DroppingServer {
1919
impl DroppingServer {
2020
fn new(schema_name: &str) -> Self {
2121
let dir = geoengine_services::util::config::retrieve_settings_dir().unwrap();
22+
eprintln!("Settings dir: {:?}", dir);
2223

2324
let process = Command::cargo_bin("main")
2425
.unwrap()
@@ -62,7 +63,7 @@ async fn it_starts_without_warnings_and_accepts_connections() {
6263
// read log output and check for warnings
6364
let mut startup_succesful = false;
6465
for line in server.stderr_lines().take(100) {
65-
// eprintln!("Line: {line}");
66+
eprintln!("Line: {line}");
6667

6768
assert!(!line.contains("WARN"), "Warning in log output: {line}");
6869

0 commit comments

Comments
 (0)