From: Youness Alaoui Date: Thu, 8 Jan 2015 20:22:03 +0000 (-0500) Subject: Write slicer log to debug.log in cura config directory X-Git-Tag: lulzbot-15.02.1-1.01~75^2~4^2~6 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=9b80bacb69e83f0ffb1251679f0b8a98bac6d45b;p=cura.git 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 --- 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