Skip to content

Commit a0da49b

Browse files
author
Riley Priddle
committed
added missing imports to json
updated log message identifier
1 parent 2a4fa37 commit a0da49b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ The purpose of this module is to correctly log out the AWS Lambda event and resp
99
The firetail_handler is a decorator that wraps around an event handler function in a AWS Lambda to extract the event and response payloads into a base64 logging message.
1010

1111
###Supported Lambda Runtimes
12-
- [x] Python 3.7
13-
- [x] Python 3.8
14-
- [x] Python 3.9
12+
Python 3.7
13+
Python 3.8
14+
Python 3.9
1515

1616
###Installation
1717
Install the module with using pip
@@ -23,6 +23,7 @@ pip install -U firetail-lambda
2323

2424
Implementing Middleware in lambda function
2525
```python
26+
import json
2627
from firetail_lambda import firetail_handler, firetail_app
2728

2829
app = firetail_app()
@@ -38,6 +39,7 @@ def lambda_handler(event, context):
3839
```
3940
Multiple Event handlers
4041
```python
42+
import json
4143
from firetail_lambda import firetail_handler, firetail_app
4244

4345
app = firetail_app()
@@ -63,6 +65,8 @@ def lambda_handler_2(event, context):
6365

6466
Custom Sanitization callback
6567
```python
68+
import copy
69+
import json
6670
from firetail_lambda import firetail_handler, firetail_app
6771

6872
def sanitize_payloads(event, response):

firetail_lambda/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def wrapper_func(*args, **kwargs):
3232
# Create our log payload, and print it
3333
event, response = self.sanitization_callback(event, response)
3434
log_payload = base64.b64encode(json.dumps({"event": event,"response": response}).encode("utf-8")).decode("ascii")
35-
print("firetail:loggingapi:%s" % (log_payload))
35+
print("firetail:log-ext:%s" % (log_payload))
3636

3737
## Ensure the execution time is >25ms to give the logs API time to propagate our print() to the extension.
3838
if self.enable_sleeper:

0 commit comments

Comments
 (0)