about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-10-27 04:51:43 -0500
committerFrederick Muriuki Muriithi2025-10-27 04:51:43 -0500
commit019282e64fb401f7a6823f3c8914d1d6e5ad0233 (patch)
tree20b4ad645a15eabf8de89f4f8e35eb533a694490
parent8fd92f3c72da4de1aa1a912954df36ebdfa46079 (diff)
downloadgenenetwork3-019282e64fb401f7a6823f3c8914d1d6e5ad0233.tar.gz
Enable logging in `gn3.db.menu` module.
-rw-r--r--gn3/app.py3
-rw-r--r--gn3/db/menu.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/gn3/app.py b/gn3/app.py
index 0868f3a..9a4269c 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -85,7 +85,8 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
     # END: SECRETS
     verify_app_config(app)
     setup_app_logging(app)
-    setup_modules_logging(loglevel(app), ("gn_libs.mysqldb",))
+    setup_modules_logging(loglevel(app), ("gn3.db.menu",
+                                          "gn_libs.mysqldb"))
     # DO NOT log anything before this point
     logging.info("Guix Profile: '%s'.", os.environ.get("GUIX_PROFILE"))
     logging.info("Python Executable: '%s'.", sys.executable)
diff --git a/gn3/db/menu.py b/gn3/db/menu.py
index 3fe9062..34dedde 100644
--- a/gn3/db/menu.py
+++ b/gn3/db/menu.py
@@ -1,10 +1,12 @@
 """Menu generation code for the data in the dropdowns in the index page."""
-
+import logging
 from typing import Tuple
 from functools import reduce
 
 from gn3.db.species import get_all_species
 
+logger = logging.getLogger(__name__)
+
 def gen_dropdown_json(conn):
     """
     Generates and outputs (as json file) the data for the main dropdown menus on
@@ -37,6 +39,7 @@ def get_groups(conn, species_names: Tuple[str, ...]):
             "IFNULL(InbredSet.Family, InbredSet.FullName) ASC, "
             "InbredSet.FullName ASC, "
             "InbredSet.MenuOrderId ASC")
+        logger.debug("'get_groups' QUERY: %s, %s", query, species_names)
         cursor.execute(query, tuple(species_names))
         results = cursor.fetchall()