Skip to content

Commit

Permalink
Merge pull request #16765 from Ultimaker/CURA-11064-log-backend-plugi…
Browse files Browse the repository at this point in the history
…n-stdout

Log backend plugin std out
  • Loading branch information
rburema authored Sep 19, 2023
2 parents 22885d3 + 1e360e1 commit 5e1e6e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cura/BackendPlugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,15 @@ def start(self) -> bool:
# STDIN needs to be None because we provide no input, but communicate via a local socket instead.
# The NUL device sometimes doesn't exist on some computers.
Logger.info(f"Starting backend_plugin [{self._plugin_id}] with command: {self._validatePluginCommand()}")
popen_kwargs = {"stdin": None}
popen_kwargs = {"stdin": None, "stdout": subprocess.PIPE, "stderr": subprocess.PIPE}
if Platform.isWindows():
popen_kwargs["creationflags"] = subprocess.CREATE_NO_WINDOW
self._process = subprocess.Popen(self._validatePluginCommand(), **popen_kwargs)
stdout_data, stderr_data = self._process.communicate()
if stderr_data:
Logger.warning(f"Info on error-stream when starting backend_plugin [{self._plugin_id}] stderr: {str(stderr_data)}")
Logger.info(
f"Started backend_plugin [{self._plugin_id}] with PID: {self._process.pid}, stdout: {str(stdout_data)}")
self._is_running = True
return True
except PermissionError:
Expand Down

0 comments on commit 5e1e6e2

Please sign in to comment.