Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref: Provide better user messages for properties file configs #1336

Merged
merged 1 commit into from Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/config.rs
Expand Up @@ -10,7 +10,7 @@ use anyhow::{bail, format_err, Context, Error, Result};
use clap::ArgMatches;
use ini::Ini;
use lazy_static::lazy_static;
use log::set_max_level;
use log::{debug, info, set_max_level, warn};
use parking_lot::Mutex;
use sentry::types::Dsn;

Expand Down Expand Up @@ -518,11 +518,17 @@ fn load_cli_config() -> Result<(PathBuf, Ini)> {
bail!("Could not load java style properties file: {}", err);
}
};
info!(
"Loaded file referenced by SENTRY_PROPERTIES ({})",
&prop_path
);
for (key, value) in props {
let mut iter = key.rsplitn(2, '.');
if let Some(key) = iter.next() {
let section = iter.next();
rv.set_to(section, key.to_string(), value);
} else {
debug!("Incorrect properties file key: {}", key);
}
}
}
Expand All @@ -532,6 +538,11 @@ fn load_cli_config() -> Result<(PathBuf, Ini)> {
"Failed to load file referenced by SENTRY_PROPERTIES ({})",
&prop_path
)));
} else {
warn!(
"Failed to find file referenced by SENTRY_PROPERTIES ({})",
&prop_path
);
}
}
}
Expand Down