Skip to content

fix(logger): fix exception on flush without buffer #6794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions aws_lambda_powertools/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,10 @@

tracer_id = get_tracer_id()

# no buffer config? return
if not self._buffer_config:
return

Check warning on line 1202 in aws_lambda_powertools/logging/logger.py

View check run for this annotation

Codecov / codecov/patch

aws_lambda_powertools/logging/logger.py#L1202

Added line #L1202 was not covered by tests

# Flushing log without a tracer id? Return
if not tracer_id:
return
Expand All @@ -1206,9 +1210,6 @@
if not buffer:
return

if not self._buffer_config:
return

# Check ALC level against buffer level
lambda_log_level = self._get_aws_lambda_log_level()
if lambda_log_level:
Expand Down
Loading