diff --git a/src/config.rs b/src/config.rs index 4c31318..93a1818 100644 --- a/src/config.rs +++ b/src/config.rs @@ -27,6 +27,10 @@ pub struct Config { pub open_ai: Option, } +pub struct ConfigLoadResult { + pub config: Config, +} + const CONFIG_FILE_PATH: &str = "./conf.toml"; impl Config { @@ -38,6 +42,11 @@ impl Config { pub fn builder() -> Result> { let p = std::path::PathBuf::from(CONFIG_FILE_PATH); if !p.exists() { + // TODO: this won't output since tracing is not setup before we load + // config, so we need something like + // https://docs.rs/tracing-capture/latest/tracing_capture/ + // to capture trace events to be output _after_ configuration has + // loaded and the "actual" subscriber is setup warn!( "Config file '{}' doesn't exist, so defaults will likely be loaded!", p.display(),