Skip to content

Commit

Permalink
Patch: resolves logging import PR #3
Browse files Browse the repository at this point in the history
Fix logging import. Resolves #3
  • Loading branch information
heitorlessa authored Jan 9, 2020
2 parents 728261d + ed6a2d9 commit 780addb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
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("<")

0 comments on commit 780addb

Please sign in to comment.