File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
src/eligibility_signposting_api Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change 88from mangum .types import LambdaContext , LambdaEvent
99
1010from eligibility_signposting_api import repos , services
11- from eligibility_signposting_api .config import LOG_LEVEL , config , setup_logging
11+ from eligibility_signposting_api .config import LOG_LEVEL , config , init_logging
1212from eligibility_signposting_api .error_handler import handle_exception
1313from eligibility_signposting_api .views .eligibility import eligibility
1414from eligibility_signposting_api .views .hello import hello
1515
16- setup_logging ()
16+ init_logging ()
1717logger = logging .getLogger (__name__ )
1818
1919def main () -> None : # pragma: no cover
Original file line number Diff line number Diff line change 44
55from yarl import URL
66
7- LOG_LEVEL = logging .DEBUG
7+ LOG_LEVEL = logging .getLevelNamesMapping (). get ( os . getenv ( "LOG_LEVEL" , None ), logging . WARNING )
88
99AwsRegion = NewType ("AwsRegion" , str )
1010AwsAccessKey = NewType ("AwsAccessKey" , str )
@@ -20,11 +20,10 @@ def config() -> dict[str, Any]:
2020 }
2121
2222
23- def setup_logging () :
23+ def init_logging () -> None :
2424 log_format = "%(asctime)s %(levelname)-8s %(name)s %(module)s.py:%(funcName)s():%(lineno)d %(message)s"
25- # Define the root logger configuration
2625 logging .basicConfig (
27- level = logging . DEBUG ,
26+ level = LOG_LEVEL ,
2827 format = log_format ,
2928 handlers = [
3029 logging .StreamHandler ()
You can’t perform that action at this time.
0 commit comments