Skip to content

Commit 284c4e8

Browse files
committed
fix: orphan exception must not be shadowed by attr exc
1 parent bb64924 commit 284c4e8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

aws_lambda_powertools/logging/exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ class InvalidLoggerSamplingRateError(Exception):
22
pass
33

44

5-
class OrphanedChildLoggerError(AttributeError):
5+
class OrphanedChildLoggerError(Exception):
66
pass

aws_lambda_powertools/logging/logger.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ def structure_logs(self, append: bool = False, formatter_options: Optional[Dict]
631631

632632
# Mode 1
633633
log_keys = {**self._default_log_keys, **keys}
634-
is_logger_preconfigured = getattr(self._logger, "init", False)
634+
is_logger_preconfigured = getattr(self._logger, LOGGER_ATTRIBUTE_PRECONFIGURED, False)
635635
if not is_logger_preconfigured:
636636
formatter = self.logger_formatter or LambdaPowertoolsFormatter(**formatter_options, **log_keys)
637637
self.registered_handler.setFormatter(formatter)

0 commit comments

Comments
 (0)