From 605c8cc8b6a099fd460053f62cffeaa483e5c912 Mon Sep 17 00:00:00 2001 From: Marcus Yanello <94466282+MYanello@users.noreply.github.com> Date: Sun, 12 Jun 2022 11:47:50 -0500 Subject: [PATCH 1/3] Attempt to use pipe to store log --- core/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app.py b/core/app.py index 656b5413..a6e4d3b6 100644 --- a/core/app.py +++ b/core/app.py @@ -555,9 +555,9 @@ def invoke_custom_command(self): # a workaround to make the damn thing work. exepath, args = match.groups() path, exename = op.split(exepath) - subprocess.Popen(exename + args, shell=True, cwd=path) + subprocess.Popen(exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) else: - subprocess.Popen(dupe_cmd, shell=True) + subprocess.Popen(dupe_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) def load(self): """Load directory selection and ignore list from files in appdata. From 22b2b6b11075d93d15fc569f948155ad61e3964c Mon Sep 17 00:00:00 2001 From: Marcus Yanello Date: Sun, 12 Jun 2022 20:43:59 +0000 Subject: [PATCH 2/3] "Send the logs for the custom command subprocess to the logs" --- core/app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/app.py b/core/app.py index a6e4d3b6..3dfa3dcd 100644 --- a/core/app.py +++ b/core/app.py @@ -555,9 +555,13 @@ def invoke_custom_command(self): # a workaround to make the damn thing work. exepath, args = match.groups() path, exename = op.split(exepath) - subprocess.Popen(exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + p = subprocess.Popen(exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + output = p.stdout.read() + logging.info("Custom command %s %s:\n %s", exename, args, output) else: - subprocess.Popen(dupe_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + p = subprocess.Popen(dupe_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + output = p.stdout.read() + logging.info("Custom command %s:\n %s", dupe_cmd, output) def load(self): """Load directory selection and ignore list from files in appdata. From d2195190a29a44862223b85768220a41c124ebcf Mon Sep 17 00:00:00 2001 From: Marcus Yanello <94466282+MYanello@users.noreply.github.com> Date: Mon, 13 Jun 2022 20:56:29 -0500 Subject: [PATCH 3/3] Remove line break from custom command log --- core/app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/app.py b/core/app.py index 3dfa3dcd..0d30680b 100644 --- a/core/app.py +++ b/core/app.py @@ -557,11 +557,11 @@ def invoke_custom_command(self): path, exename = op.split(exepath) p = subprocess.Popen(exename + args, shell=True, cwd=path, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = p.stdout.read() - logging.info("Custom command %s %s:\n %s", exename, args, output) + logging.info("Custom command %s %s: %s", exename, args, output) else: p = subprocess.Popen(dupe_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) output = p.stdout.read() - logging.info("Custom command %s:\n %s", dupe_cmd, output) + logging.info("Custom command %s: %s", dupe_cmd, output) def load(self): """Load directory selection and ignore list from files in appdata.