-
Notifications
You must be signed in to change notification settings - Fork 411
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(logger): correctly pick powertools or custom handler in custom en…
…vironments (#6083) * Fixing Powertools logger handler * Fixing Powertools logger handler * Make code check tool happy
- Loading branch information
1 parent
4ad37b5
commit df75e42
Showing
6 changed files
with
176 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from aws_lambda_powertools import Logger | ||
|
||
# Instance 1 | ||
logger = Logger() | ||
|
||
# Simulating importing from another file | ||
logger = Logger() | ||
|
||
|
||
@logger.inject_lambda_context | ||
def lambda_handler(event, context): | ||
message, append_keys = event.get("message", ""), event.get("append_keys", {}) | ||
logger.append_keys(**append_keys) | ||
logger.info(message) | ||
return "success" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters