From 7f2dd1bffa541e9e389ee399d76e17f375458bb3 Mon Sep 17 00:00:00 2001 From: Nikita Karetnikov Date: Mon, 18 Dec 2023 18:25:22 +0100 Subject: [PATCH] Use the logging module instead of prints --- .../conda_store_server/action/generate_lockfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/conda-store-server/conda_store_server/action/generate_lockfile.py b/conda-store-server/conda_store_server/action/generate_lockfile.py index 5890dfa29..2fa2c327a 100644 --- a/conda-store-server/conda_store_server/action/generate_lockfile.py +++ b/conda-store-server/conda_store_server/action/generate_lockfile.py @@ -26,8 +26,10 @@ def action_solve_lockfile( json.dump(specification.dict(), f) def print_cmd(cmd): - print(f"Running command: {' '.join(cmd)}") - print(subprocess.check_output(cmd, stderr=subprocess.STDOUT, encoding="utf-8")) + context.log.info(f"Running command: {' '.join(cmd)}") + context.log.info( + subprocess.check_output(cmd, stderr=subprocess.STDOUT, encoding="utf-8") + ) # The info command can be used with either mamba or conda print_cmd([conda_command, "info"])