Skip to content

Commit cc7d9b4

Browse files
committed
feat(logger): add remaining debug method
1 parent b456eb3 commit cc7d9b4

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

aws_lambda_powertools/logging/logger.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,26 @@ def warning(
464464
msg, *args, exc_info=exc_info, stack_info=stack_info, stacklevel=stacklevel, extra=extra
465465
)
466466

467+
def debug(
468+
self,
469+
msg: object,
470+
*args,
471+
exc_info=None,
472+
stack_info: bool = False,
473+
stacklevel: int = 2,
474+
extra: Optional[Mapping[str, object]] = None,
475+
**kwargs,
476+
):
477+
extra = extra or {}
478+
extra = {**extra, **kwargs}
479+
480+
# Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
481+
if sys.version_info < (3, 8): # pragma: no cover
482+
return self._logger.debug(msg, *args, exc_info=exc_info, stack_info=stack_info, extra=extra)
483+
return self._logger.debug(
484+
msg, *args, exc_info=exc_info, stack_info=stack_info, stacklevel=stacklevel, extra=extra
485+
)
486+
467487
def append_keys(self, **additional_keys):
468488
self.registered_formatter.append_keys(**additional_keys)
469489

0 commit comments

Comments
 (0)