Skip to content

Commit fe50c12

Browse files
Addressing Ruben's feedback
1 parent fd1cc46 commit fe50c12

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aws_lambda_powertools/logging/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def append_keys(self, **additional_keys: object) -> None:
584584
self.registered_formatter.append_keys(**additional_keys)
585585

586586
def get_current_keys(self) -> Dict[str, Any]:
587-
if hasattr(self.registered_formatter, "log_format"):
587+
if isinstance(self.registered_formatter, LambdaPowertoolsFormatter):
588588
return self.registered_formatter.get_current_keys()
589589

590590
return {}

docs/core/logger.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ The `log` argument is the final log record containing [our standard keys](#stand
742742
For exceptional cases where you want to completely replace our formatter logic, you can subclass `BasePowertoolsFormatter`.
743743

744744
???+ warning
745-
You will need to implement `append_keys`, `clear_state`, override `format`, and optionally `get_current_keys`, and `remove_keys` to keep the same feature set Powertools for AWS Lambda (Python) Logger provides. This also means keeping state of logging keys added.
745+
You will need to implement `append_keys`, `clear_state`, override `format`, and optionally `get_current_keys`, and `remove_keys` to keep the same feature set Powertools for AWS Lambda (Python) Logger provides. This also means tracking the added logging keys.
746746

747747
=== "bring_your_own_formatter_from_scratch.py"
748748

0 commit comments

Comments
 (0)