2222 overload ,
2323)
2424
25- from aws_lambda_powertools .logging import compat
2625from aws_lambda_powertools .shared import constants
2726from aws_lambda_powertools .shared .functions import (
2827 extract_event_from_common_models ,
@@ -302,9 +301,6 @@ def _init_logger(
302301 self .addHandler (self .logger_handler )
303302 self .structure_logs (formatter_options = formatter_options , ** kwargs )
304303
305- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
306- self ._logger .findCaller = compat .findCaller # type: ignore[method-assign]
307-
308304 # Pytest Live Log feature duplicates log records for colored output
309305 # but we explicitly add a filter for log deduplication.
310306 # This flag disables this protection when you explicit want logs to be duplicated (#262)
@@ -467,9 +463,6 @@ def info(
467463 extra = extra or {}
468464 extra = {** extra , ** kwargs }
469465
470- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
471- if sys .version_info < (3 , 8 ): # pragma: no cover
472- return self ._logger .info (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
473466 return self ._logger .info (
474467 msg ,
475468 * args ,
@@ -492,9 +485,6 @@ def error(
492485 extra = extra or {}
493486 extra = {** extra , ** kwargs }
494487
495- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
496- if sys .version_info < (3 , 8 ): # pragma: no cover
497- return self ._logger .error (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
498488 return self ._logger .error (
499489 msg ,
500490 * args ,
@@ -517,9 +507,6 @@ def exception(
517507 extra = extra or {}
518508 extra = {** extra , ** kwargs }
519509
520- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
521- if sys .version_info < (3 , 8 ): # pragma: no cover
522- return self ._logger .exception (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
523510 return self ._logger .exception (
524511 msg ,
525512 * args ,
@@ -542,9 +529,6 @@ def critical(
542529 extra = extra or {}
543530 extra = {** extra , ** kwargs }
544531
545- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
546- if sys .version_info < (3 , 8 ): # pragma: no cover
547- return self ._logger .critical (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
548532 return self ._logger .critical (
549533 msg ,
550534 * args ,
@@ -567,9 +551,6 @@ def warning(
567551 extra = extra or {}
568552 extra = {** extra , ** kwargs }
569553
570- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
571- if sys .version_info < (3 , 8 ): # pragma: no cover
572- return self ._logger .warning (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
573554 return self ._logger .warning (
574555 msg ,
575556 * args ,
@@ -592,9 +573,6 @@ def debug(
592573 extra = extra or {}
593574 extra = {** extra , ** kwargs }
594575
595- # Maintenance: We can drop this upon Py3.7 EOL. It's a backport for "location" key to work
596- if sys .version_info < (3 , 8 ): # pragma: no cover
597- return self ._logger .debug (msg , * args , exc_info = exc_info , stack_info = stack_info , extra = extra )
598576 return self ._logger .debug (
599577 msg ,
600578 * args ,
0 commit comments