aboutsummaryrefslogtreecommitdiff
path: root/gn3/app.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-06-05 06:16:28 +0300
committerFrederick Muriuki Muriithi2023-06-05 06:16:28 +0300
commit1a22f2b5dedd3a685bb2869f1b51f590eca36c5a (patch)
tree732886f5b7742e15390e13bb042aa677232bee96 /gn3/app.py
parent439eb22f75c402bc91efb8cd37cb4e67f2fc09ca (diff)
downloadgenenetwork3-1a22f2b5dedd3a685bb2869f1b51f590eca36c5a.tar.gz
Logging: Get user information.
Diffstat (limited to 'gn3/app.py')
-rw-r--r--gn3/app.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gn3/app.py b/gn3/app.py
index b55b6ff..ffde223 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -1,6 +1,8 @@
"""Entry point from spinning up flask"""
import os
import sys
+import logging
+import getpass
from typing import Dict
from typing import Union
@@ -44,10 +46,11 @@ 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)
- app.logger.info(f"Guix Profile: {os.environ.get('GUIX_PROFILE')}.")
- app.logger.info(f"Python Executable: '{sys.executable}'.")
+ # DO NOT log anything before this point
+ logging.info("Guix Profile: '%s'." % (os.environ.get("GUIX_PROFILE"),))
+ logging.info("Python Executable: '%s'." % sys.executable)
+ logging.info("Effective User: '%s'." % getpass.getuser())
CORS(
app,