Skip to content

fix: logging import to use vended version #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions python/aws_lambda_powertools/logging/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
from distutils.util import strtobool
from typing import Any, Callable, Dict

import aws_lambda_logging

from . import aws_lambda_logging
from ..helper.models import MetricUnit, build_lambda_context_model, build_metric_unit_from_str

logger = logging.getLogger(__name__)
Expand Down
23 changes: 1 addition & 22 deletions python/tests/functional/test_aws_lambda_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,4 @@ class X:

log_dict = json.loads(stdout.getvalue())

assert log_dict["message"]["x"].startswith("<")


def test_wrap():
from aws_lambda_logging import wrap

@wrap
def handler(event, context):
pass

handler(None, None)


def test_wrap_when_request_id_is_in_event():
from aws_lambda_logging import wrap

@wrap
def handler(event, context):
pass

event = {"requestContext": {"requestId": "c19e27e6-230b-11e8-ba47-a95ceb1c6480"}}
handler(event, None)
assert log_dict["message"]["x"].startswith("<")