print config vars to console #101

Open
opened 2 years ago by glitch4347 · 0 comments
glitch4347 commented 2 years ago (Migrated from github.com)
Owner

There is a comment in the code

impl Config {
    pub fn new() -> anyhow::Result<Config> {
        let mut config = config::Config::default();

        if std::path::Path::new("config.toml").exists() {
            config.merge(config::File::with_name("config")).unwrap();
        }

        update_from_env(&mut config);

        if config.get::<u16>("port").is_err() {
            config.set("port", 4347).unwrap();
        }

        // TODO: print resulted config (perfectly, it needs adding `derive(Debug)` in `subbeat`'s `DatasourceConfig`)
        Ok(Config {
            port: config.get::<u16>("port").unwrap(),
            datasource_config: resolve_datasource(&config)?,
            alerting: resolve_alerting(&config)?,
        })
    }
}

so this issue is about printing to log (console) variables values

There is a comment in the code ```rust impl Config { pub fn new() -> anyhow::Result<Config> { let mut config = config::Config::default(); if std::path::Path::new("config.toml").exists() { config.merge(config::File::with_name("config")).unwrap(); } update_from_env(&mut config); if config.get::<u16>("port").is_err() { config.set("port", 4347).unwrap(); } // TODO: print resulted config (perfectly, it needs adding `derive(Debug)` in `subbeat`'s `DatasourceConfig`) Ok(Config { port: config.get::<u16>("port").unwrap(), datasource_config: resolve_datasource(&config)?, alerting: resolve_alerting(&config)?, }) } } ``` so this issue is about printing to log (console) variables values
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.