Skip to content

Commit 4cf254c

Browse files
Danilo_Silva@epam.comDanilo_Silva@epam.com
Danilo_Silva@epam.com
authored and
Danilo_Silva@epam.com
committed
additional assertion to check message from stdout.
minor reformat removal ( pycharm pep8 complains with 120 characters on line )
1 parent bec6d91 commit 4cf254c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/aws_lambda_powertools/logging/logger.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,7 @@ def logger_setup(
7272
log_level = logging.DEBUG
7373
except ValueError:
7474
raise ValueError(
75-
f"Expected a float value ranging 0 to 1, but received {sampling_rate} instead. Please review "
76-
f"POWERTOOLS_LOGGER_SAMPLE_RATE environment variable."
75+
f"Expected a float value ranging 0 to 1, but received {sampling_rate} instead. Please review POWERTOOLS_LOGGER_SAMPLE_RATE environment variable."
7776
)
7877

7978
logger.setLevel(log_level)

python/tests/functional/test_logger.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ def test_setup_sampling_rate(monkeypatch, root_logger, stdout):
9595

9696
assert sampling_rate == log["sampling_rate"]
9797
assert "DEBUG" == log["level"]
98+
assert "I am being sampled" == log["message"]
9899

99100

100101
def test_inject_lambda_context(root_logger, stdout, lambda_context):

0 commit comments

Comments
 (0)