my-aws-helpers 1.6.0__py2.py3-none-any.whl → 1.7.0__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of my-aws-helpers might be problematic. Click here for more details.
- my_aws_helpers/logging.py +14 -0
- {my_aws_helpers-1.6.0.dist-info → my_aws_helpers-1.7.0.dist-info}/METADATA +1 -1
- {my_aws_helpers-1.6.0.dist-info → my_aws_helpers-1.7.0.dist-info}/RECORD +6 -5
- {my_aws_helpers-1.6.0.dist-info → my_aws_helpers-1.7.0.dist-info}/WHEEL +0 -0
- {my_aws_helpers-1.6.0.dist-info → my_aws_helpers-1.7.0.dist-info}/top_level.txt +0 -0
- {my_aws_helpers-1.6.0.dist-info → my_aws_helpers-1.7.0.dist-info}/zip-safe +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
import os
|
|
3
|
+
|
|
4
|
+
def select_powertools_logger(service_name: str) -> logging.Logger:
|
|
5
|
+
"""
|
|
6
|
+
Returns the powertools logger if it can be found,
|
|
7
|
+
Returns a Logger with name = service_name if powertools logger is not found
|
|
8
|
+
"""
|
|
9
|
+
existing_loggers = [name for name in logging.root.manager.loggerDict]
|
|
10
|
+
powertools_service_name = os.environ.get("POWERTOOLS_SERVICE_NAME")
|
|
11
|
+
if powertools_service_name is not None:
|
|
12
|
+
logger = logging.getLogger(powertools_service_name) if powertools_service_name in existing_loggers else None
|
|
13
|
+
if logger: return logger
|
|
14
|
+
return logging.getLogger(service_name)
|
|
@@ -2,10 +2,11 @@ my_aws_helpers/api.py,sha256=ph-MjSYl7mg_I1fN7S2DBRgQS90Spa8ARBiSZ6trliE,2330
|
|
|
2
2
|
my_aws_helpers/cognito.py,sha256=gSaPncfzvnYJykf-Q9Mv8LGwJssynMBYL6LhOuF89_M,6447
|
|
3
3
|
my_aws_helpers/dynamo.py,sha256=klDKoDujIuitp6c_yc1EWHkS67GJpXbck1ymhEgIMhE,4059
|
|
4
4
|
my_aws_helpers/errors.py,sha256=_SCvVGOPYrkhOAxkO22u1cASGcBL8afHtg3xwX_FmY0,156
|
|
5
|
+
my_aws_helpers/logging.py,sha256=ojJCr-g5zC1xZNCmVG4kpqo5SOxZWQ8rVK5hyFu_R_k,626
|
|
5
6
|
my_aws_helpers/s3.py,sha256=79lBRxbs4-pkUlg3Pysx8YE9RHCdgfo1Y9-xxvNwrug,4062
|
|
6
7
|
my_aws_helpers/sfn.py,sha256=YBuOMAhmCP2GzPMSDJ7bDe38eI7m9m5uiaeP6mwy3_Y,1848
|
|
7
|
-
my_aws_helpers-1.
|
|
8
|
-
my_aws_helpers-1.
|
|
9
|
-
my_aws_helpers-1.
|
|
10
|
-
my_aws_helpers-1.
|
|
11
|
-
my_aws_helpers-1.
|
|
8
|
+
my_aws_helpers-1.7.0.dist-info/METADATA,sha256=NYKJiqvqZVoZCZ_aqEEkyXUjIpHy9xzLxpkN2URXlSA,452
|
|
9
|
+
my_aws_helpers-1.7.0.dist-info/WHEEL,sha256=0VNUDWQJzfRahYI3neAhz2UVbRCtztpN5dPHAGvmGXc,109
|
|
10
|
+
my_aws_helpers-1.7.0.dist-info/top_level.txt,sha256=RK29MPT4_whrlRXrq_mXuB1Mo_xIyCI5BZc6QeP0olQ,15
|
|
11
|
+
my_aws_helpers-1.7.0.dist-info/zip-safe,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
12
|
+
my_aws_helpers-1.7.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|