From e6c080fb5852cfc8e270b869c5186dd97ff8e6c7 Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Sat, 13 Apr 2024 10:59:47 -0500 Subject: [PATCH] Add todo --- src/config.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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(),