Skip to content

Commit f5f4c0f

Browse files
committed
Fix: Making the log_init option available even if the log feature is not enabled
1 parent 1cdfabb commit f5f4c0f

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

  • lambda-appsync-proc/src/appsync_lambda_main

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ enum OptionalParameter {
7070
ExcludeAppsyncOperations(bool),
7171
OnlyAppsyncOperations(bool),
7272
Hook(Ident),
73-
#[cfg(feature = "log")]
7473
LogInit(Ident),
7574
#[cfg(feature = "log")]
7675
EventLogging(bool),
@@ -98,7 +97,6 @@ impl Parse for OptionalParameter {
9897
input.parse::<LitBool>()?.value(),
9998
)),
10099
"hook" => Ok(Self::Hook(input.parse()?)),
101-
#[cfg(feature = "log")]
102100
"log_init" => Ok(Self::LogInit(input.parse()?)),
103101
#[cfg(feature = "log")]
104102
"event_logging" => Ok(Self::EventLogging(input.parse::<LitBool>()?.value())),
@@ -156,7 +154,6 @@ struct OptionalParameters {
156154
appsync_operations: bool,
157155
lambda_handler: bool,
158156
hook: Option<Ident>,
159-
#[cfg(feature = "log")]
160157
log_init: Option<Ident>,
161158
#[cfg(feature = "log")]
162159
event_logging: bool,
@@ -171,7 +168,6 @@ impl Default for OptionalParameters {
171168
appsync_operations: true,
172169
lambda_handler: true,
173170
hook: None,
174-
#[cfg(feature = "log")]
175171
log_init: None,
176172
#[cfg(feature = "log")]
177173
event_logging: true,
@@ -205,7 +201,6 @@ impl OptionalParameters {
205201
OptionalParameter::Hook(ident) => {
206202
self.hook.replace(ident);
207203
}
208-
#[cfg(feature = "log")]
209204
OptionalParameter::LogInit(ident) => {
210205
self.log_init.replace(ident);
211206
}
@@ -478,7 +473,6 @@ impl AppsyncLambdaMain {
478473
};
479474
let aws_client_getters = self.aws_clients.iter().map(|ac| ac.aws_client_getter());
480475

481-
#[cfg(feature = "log")]
482476
let log_init = if let Some(ref log_init) = self.options.log_init {
483477
quote_spanned! {log_init.span()=>
484478
mod _check_sig {
@@ -500,8 +494,6 @@ impl AppsyncLambdaMain {
500494
// default_log_init.extend(Self::default_fastrace_init());
501495
default_log_init
502496
};
503-
#[cfg(not(feature = "log"))]
504-
let log_init = TokenStream2::new();
505497

506498
#[allow(unused_mut)]
507499
let mut bring_in_scope = TokenStream2::new();

0 commit comments

Comments
 (0)