Skip to content

Commit 252e222

Browse files
committed
Fix: Changing the default event_logging value to 'false' and ensuring that, if true, it logs at debug level instead of info.
1 parent f5f4c0f commit 252e222

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl Default for OptionalParameters {
170170
hook: None,
171171
log_init: None,
172172
#[cfg(feature = "log")]
173-
event_logging: true,
173+
event_logging: false,
174174
tos: TypeOverrides::new(),
175175
nos: NameOverrides::new(),
176176
}
@@ -329,7 +329,7 @@ impl AppsyncLambdaMain {
329329
#[cfg(feature = "log")]
330330
if self.options.event_logging {
331331
log_lines.extend(quote! {
332-
::lambda_appsync::log::info!("event={event:?}");
332+
::lambda_appsync::log::debug!("event={event:?}");
333333
});
334334
}
335335
#[cfg(feature = "log")]
@@ -450,8 +450,7 @@ impl AppsyncLambdaMain {
450450
#[cfg(feature = "log")]
451451
if self.options.event_logging {
452452
log_lines.extend(quote! {
453-
::lambda_appsync::log::debug!("{event:?}");
454-
::lambda_appsync::log::info!("{}", ::lambda_appsync::serde_json::json!(event.payload));
453+
::lambda_appsync::log::debug!("{}", ::lambda_appsync::serde_json::json!(event.payload));
455454
});
456455
}
457456

lambda-appsync-proc/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ use proc_macro::TokenStream;
2929
///
3030
/// - `batch = bool`: Enable/disable batch request handling (default: true)
3131
/// - `hook = fn_name`: Add a custom hook function for request validation/auth
32-
/// - (feature: `log`) `log_init = fn_name`: Use a custom log initialization function instead of the default one
33-
/// - (feature: `log`) `event_logging = bool`: If true, the macro will generate code to dump the entire event in the logs (default: `true`)
32+
/// - `log_init = fn_name`: Use a custom log initialization function instead of the default one
33+
/// - (feature: `log`) `event_logging = bool`: If true, the macro will generate code to dump the
34+
/// lambda payload JSON as well as parsed `AppsyncEvent<Operation>`s in the logs at debug level (default: `false`)
3435
/// - `exclude_lambda_handler = bool`: Skip generation of Lambda handler code
3536
/// - `only_lambda_handler = bool`: Only generate Lambda handler code
3637
/// - `exclude_appsync_types = bool`: Skip generation of GraphQL type definitions
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
mod no_run {
2-
// Test with event_logging disabled
3-
lambda_appsync::appsync_lambda_main!("../../../../schema.graphql", event_logging = false);
2+
// Test with event_logging enabled
3+
lambda_appsync::appsync_lambda_main!("../../../../schema.graphql", event_logging = true);
44
}
55

66
fn main() {}

0 commit comments

Comments
 (0)