aboutsummaryrefslogtreecommitdiff
path: root/gn3/app.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-04-21 05:22:05 +0300
committerFrederick Muriuki Muriithi2023-04-21 05:22:05 +0300
commit95f067a542424b76022595a74d660a7e84158f38 (patch)
tree17cf13f89eb58e2758e79c905b5777181d1334e1 /gn3/app.py
parent1fb5633042aa730d9467ad086196df99e60de151 (diff)
downloadgenenetwork3-95f067a542424b76022595a74d660a7e84158f38.tar.gz
Setup module for logging
During development, we need logging sometimes to help with troubleshooting problems. This commit provides a module to help set up the logging in a separate module from the app module.
Diffstat (limited to 'gn3/app.py')
-rw-r--r--gn3/app.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gn3/app.py b/gn3/app.py
index 0c2f9f9..b4b4b43 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -7,6 +7,7 @@ from typing import Union
from flask import Flask
from flask_cors import CORS # type: ignore
+from gn3.loggers import setup_app_handlers
from gn3.api.gemma import gemma
from gn3.api.rqtl import rqtl
from gn3.api.general import general
@@ -42,6 +43,9 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
elif config.endswith(".py"):
app.config.from_pyfile(config)
+ # DO NOT log anything before this point
+ setup_app_handlers(app)
+
CORS(
app,
origins=app.config["CORS_ORIGINS"],