forked from beda-software/fhir-sdc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
30 lines (24 loc) · 970 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import logging
import coloredlogs
import sentry_sdk
from aidbox_python_sdk.main import create_app as _create_app
from sentry_sdk.integrations.aiohttp import AioHttpIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
# Don't remove these imports
import app.operations
from app.sdk import sdk, sdk_settings
coloredlogs.install(
level="DEBUG", fmt="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
)
logging.basicConfig(
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s", level=logging.DEBUG
)
logging.getLogger("aidbox_sdk").setLevel(logging.INFO)
logging.getLogger("urllib3").setLevel(logging.INFO)
sentry_logging = LoggingIntegration(
level=logging.DEBUG, # Capture info and above as breadcrumbs
event_level=logging.WARNING, # Send warnings as events
)
sentry_sdk.init(integrations=[AioHttpIntegration(), sentry_logging])
async def create_app():
return await _create_app(sdk_settings, sdk, debug=True)