File tree 1 file changed +17
-0
lines changed
1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ Event Source Data Classes utility provides classes self-describing Lambda event
12
12
* Type hinting and code completion for common event types
13
13
* Helper functions for decoding/deserializing nested fields
14
14
* Docstrings for fields contained in event schemas
15
+ * Implement str() to recursively inspect contents
15
16
16
17
** Background**
17
18
@@ -52,6 +53,22 @@ Same example as above, but using the `event_source` decorator
52
53
if 'helloworld' in event.path and event.http_method == 'GET':
53
54
do_something_with(event.body, user)
54
55
```
56
+
57
+ Log Data Event for Troubleshooting
58
+
59
+ === "app.py"
60
+
61
+ ```python hl_lines="4 8"
62
+ from aws_lambda_powertools.utilities.data_classes import event_source, APIGatewayProxyEvent
63
+ from aws_lambda_powertools.logging.logger import Logger
64
+
65
+ logger = Logger(service="hello_logs", level="DEBUG")
66
+
67
+ @event_source(data_class=APIGatewayProxyEvent)
68
+ def lambda_handler(event: APIGatewayProxyEvent, context):
69
+ logger.debug(event)
70
+ ```
71
+
55
72
** Autocomplete with self-documented properties and methods**
56
73
57
74
![ Utilities Data Classes] ( ../media/utilities_data_classes.png )
You can’t perform that action at this time.
0 commit comments