22
22
overload ,
23
23
)
24
24
25
- from aws_lambda_powertools .logging import compat
26
25
from aws_lambda_powertools .shared import constants
27
26
from aws_lambda_powertools .shared .functions import (
28
27
extract_event_from_common_models ,
@@ -302,9 +301,6 @@ def _init_logger(
302
301
self .addHandler (self .logger_handler )
303
302
self .structure_logs (formatter_options = formatter_options , ** kwargs )
304
303
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
-
308
304
# Pytest Live Log feature duplicates log records for colored output
309
305
# but we explicitly add a filter for log deduplication.
310
306
# This flag disables this protection when you explicit want logs to be duplicated (#262)
@@ -467,9 +463,6 @@ def info(
467
463
extra = extra or {}
468
464
extra = {** extra , ** kwargs }
469
465
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 )
473
466
return self ._logger .info (
474
467
msg ,
475
468
* args ,
@@ -492,9 +485,6 @@ def error(
492
485
extra = extra or {}
493
486
extra = {** extra , ** kwargs }
494
487
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 )
498
488
return self ._logger .error (
499
489
msg ,
500
490
* args ,
@@ -517,9 +507,6 @@ def exception(
517
507
extra = extra or {}
518
508
extra = {** extra , ** kwargs }
519
509
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 )
523
510
return self ._logger .exception (
524
511
msg ,
525
512
* args ,
@@ -542,9 +529,6 @@ def critical(
542
529
extra = extra or {}
543
530
extra = {** extra , ** kwargs }
544
531
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 )
548
532
return self ._logger .critical (
549
533
msg ,
550
534
* args ,
@@ -567,9 +551,6 @@ def warning(
567
551
extra = extra or {}
568
552
extra = {** extra , ** kwargs }
569
553
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 )
573
554
return self ._logger .warning (
574
555
msg ,
575
556
* args ,
@@ -592,9 +573,6 @@ def debug(
592
573
extra = extra or {}
593
574
extra = {** extra , ** kwargs }
594
575
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 )
598
576
return self ._logger .debug (
599
577
msg ,
600
578
* args ,
0 commit comments