Skip to content

Commit e6b1424

Browse files
committed
Fix: Both feature can be enabled at the same time, but I still have to make sure only one initialization code runs to avoid a panic
1 parent d9f30c3 commit e6b1424

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • lambda-appsync-proc/src/appsync_lambda_main

lambda-appsync-proc/src/appsync_lambda_main/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,8 +476,12 @@ impl AppsyncLambdaMain {
476476
let mut default_log_init = proc_macro2::TokenStream::new();
477477
#[cfg(feature = "env_logger")]
478478
default_log_init.extend(Self::default_env_logger_init());
479-
#[cfg(feature = "tracing")]
479+
// The code initializing tracing fails if the env_logger initialization already happened
480+
#[cfg(all(feature = "tracing", not(any(feature = "env_logger"))))]
480481
default_log_init.extend(Self::default_tracing_init());
482+
// Future default inits can be inserted here like that for feature "fastrace" (for example):
483+
// #[cfg(all(feature = "fastrace", not(any(feature = "env_logger", feature = "tracing"))))]
484+
// default_log_init.extend(Self::default_fastrace_init());
481485
default_log_init
482486
};
483487

0 commit comments

Comments
 (0)