Skip to content

Commit c1ed3d9

Browse files
authored
fix: set bottlecap log level (#575)
* fix: set bottlecap log level * fix: format
1 parent eed1883 commit c1ed3d9

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bottlecap/src/bin/bottlecap/main.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn build_function_arn(account_id: &str, region: &str, function_name: &str) -> St
184184
async fn main() -> Result<()> {
185185
let (mut aws_config, config) = load_configs();
186186

187-
enable_logging_subsystem();
187+
enable_logging_subsystem(&config);
188188
let client = reqwest::Client::builder().no_proxy().build().map_err(|e| {
189189
Error::new(
190190
std::io::ErrorKind::InvalidData,
@@ -241,9 +241,11 @@ fn load_configs() -> (AwsConfig, Arc<Config>) {
241241
(aws_config, config)
242242
}
243243

244-
fn enable_logging_subsystem() {
245-
let env_filter =
246-
"h2=off,hyper=off,reqwest=off,rustls=off,datadog-trace-mini-agent=off".to_string();
244+
fn enable_logging_subsystem(config: &Arc<Config>) {
245+
let env_filter = format!(
246+
"h2=off,hyper=off,reqwest=off,rustls=off,datadog-trace-mini-agent=off,{:?}",
247+
config.log_level
248+
);
247249
let subscriber = tracing_subscriber::fmt::Subscriber::builder()
248250
.with_env_filter(
249251
EnvFilter::try_new(env_filter).expect("could not parse log level in configuration"),

0 commit comments

Comments
 (0)