Skip to content

Commit f2bbb3a

Browse files
committed
aws#22 - Improving logging.
1 parent b45577e commit f2bbb3a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

awslambdaric/lambda_runtime_client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@
33
"""
44

55
import sys
6+
import logging
7+
68
from awslambdaric import __version__
79
from .lambda_runtime_exception import FaultException
810

11+
logging.basicConfig(
12+
format="%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s",
13+
level=logging.INFO,
14+
)
915

1016
def _user_agent():
1117
py_version = (
@@ -19,8 +25,9 @@ def _user_agent():
1925
import runtime_client
2026

2127
runtime_client.initialize_client(_user_agent())
22-
except ImportError:
23-
runtime_client = None
28+
except ImportError as import_error:
29+
logging.fatal('Failed to import "runtime_client" module. %s', import_error)
30+
raise import_error
2431

2532
from .lambda_runtime_marshaller import LambdaMarshaller
2633

0 commit comments

Comments
 (0)