about summary refs log tree commit diff
path: root/gn3/commands.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-10-27 19:16:18 -0500
committerFrederick Muriuki Muriithi2025-10-27 19:16:18 -0500
commit4345a81d92484ff5951d87feeec6bd749ab667fe (patch)
treeb97d4198e5c493f5d4df6bfc8d3f7ee2a9d664b8 /gn3/commands.py
parent51688d31004f8f7453d8190927b9c11503a453c0 (diff)
downloadgenenetwork3-4345a81d92484ff5951d87feeec6bd749ab667fe.tar.gz
Improve logging for the asynchronous background tasks.
Diffstat (limited to 'gn3/commands.py')
-rw-r--r--gn3/commands.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/gn3/commands.py b/gn3/commands.py
index 697db42..3852c41 100644
--- a/gn3/commands.py
+++ b/gn3/commands.py
@@ -28,6 +28,8 @@ from gn3.debug import __pk__
 from gn3.chancy import random_string
 from gn3.exceptions import RedisConnectionError
 
+logger = logging.getLogger(__name__)
+
 
 def compose_gemma_cmd(gemma_wrapper_cmd: str = "gemma-wrapper",
                       gemma_wrapper_kwargs: Optional[Dict] = None,
@@ -183,8 +185,7 @@ def run_cmd(cmd: str, success_codes: Tuple = (0,), env: Optional[str] = None) ->
     out = str(results.stdout, 'utf-8')
     if results.returncode not in success_codes:  # Error!
         out = str(results.stderr, 'utf-8')
-        (  # We do not always run this within an app context
-            current_app.logger.debug if current_app else logging.debug)(out)
+        logger.debug("Command output: %s", out)
     return {"code": results.returncode, "output": out}