From 9b80bacb69e83f0ffb1251679f0b8a98bac6d45b Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Thu, 8 Jan 2015 15:22:03 -0500 Subject: [PATCH] Write slicer log to debug.log in cura config directory This will ensure we can see what went wrong in case of error, and it also gives us the debug log when no error occured. It's a nicer fix for issue #45 --- Cura/util/sliceEngine.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index e1834362..df623112 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -391,6 +391,14 @@ class Engine(object): returnCode = self._process.wait() logThread.join() + self._result.addLog("Slicer process returned : %d" % returnCode) + try: + with open(os.path.join(profile.getBasePath(), 'debug.log'), "w") as f: + for line in self._result.getLog(): + f.write(line + "\n") + except: + pass + if returnCode == 0: pluginError = pluginInfo.runPostProcessingPlugins(self._result) if pluginError is not None: @@ -399,10 +407,6 @@ class Engine(object): self._result.setFinished(True) self._callback(1.0) else: - # We do not print the slicer log because it can quickly fill up - # the .xsession-errors file if cura gets launched from the WM on Linux - #for line in self._result.getLog(): - # print line self._callback(-1.0) self._process = None -- 2.30.2