diff --git a/Cargo.lock b/Cargo.lock index b9ffce2777..515e37fbfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4416,6 +4416,7 @@ dependencies = [ "schemars 0.8.22", "serde", "serde_json", + "tracing", "url", "uuid", ] diff --git a/engine/packages/config/Cargo.toml b/engine/packages/config/Cargo.toml index ddfee56334..7e3936ea49 100644 --- a/engine/packages/config/Cargo.toml +++ b/engine/packages/config/Cargo.toml @@ -18,3 +18,4 @@ serde_json.workspace = true serde.workspace = true url.workspace = true uuid.workspace = true +tracing.workspace = true diff --git a/engine/packages/config/src/lib.rs b/engine/packages/config/src/lib.rs index 3ac5186e28..93cf30f2b7 100644 --- a/engine/packages/config/src/lib.rs +++ b/engine/packages/config/src/lib.rs @@ -79,11 +79,15 @@ fn add_source>( let path = path.as_ref(); if !path.exists() { + tracing::debug!(path=%path.display(), "ignoring non-existent config path"); + // Silently ignore non-existent paths return Ok(settings); } if path.is_dir() { + tracing::debug!(path=%path.display(), "loading config from directory"); + for entry in std::fs::read_dir(path)? { let entry = entry?; let path = entry.path(); @@ -96,9 +100,14 @@ fn add_source>( } } } else if path.is_file() { + tracing::debug!(path=%path.display(), "loading config from file"); + settings = add_file_source(settings, path)?; } else { - bail!("Invalid path: {}", path.display()); + bail!( + "Invalid Rivet config path: {}. Ensure the path exists and is either a directory with config files or a specific config file.", + path.display() + ); } Ok(settings)