Skip to content

Commit 2f828cd

Browse files
committed
refactor: update methods to use append_keys
1 parent 456846a commit 2f828cd

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

aws_lambda_powertools/logging/logger.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def handler(event, context):
271271
def decorate(event, context):
272272
lambda_context = build_lambda_context_model(context)
273273
cold_start = _is_cold_start()
274-
self.structure_logs(append=True, cold_start=cold_start, **lambda_context.__dict__)
274+
self.append_keys(cold_start=cold_start, **lambda_context.__dict__)
275275

276276
if correlation_id_path:
277277
self.set_correlation_id(jmespath.search(correlation_id_path, event))
@@ -316,7 +316,7 @@ def structure_logs(self, append: bool = False, **keys):
316316
"""
317317

318318
if append:
319-
# Maintenance: Add deprecation warning for major version, refer to append_keys() when docs are updated
319+
# Maintenance: Add deprecation warning for major version. Refer to append_keys() when docs are updated
320320
self.append_keys(**keys)
321321
else:
322322
# Set a new formatter for a logger handler
@@ -330,7 +330,7 @@ def set_correlation_id(self, value: str):
330330
value : str
331331
Value for the correlation id
332332
"""
333-
self.structure_logs(append=True, correlation_id=value)
333+
self.append_keys(correlation_id=value)
334334

335335
@staticmethod
336336
def _get_log_level(level: Union[str, int, None]) -> Union[str, int]:

0 commit comments

Comments
 (0)