chiark / gitweb /
Write slicer log to debug.log in cura config directory
authorYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 8 Jan 2015 20:22:03 +0000 (15:22 -0500)
committerYouness Alaoui <kakaroto@kakaroto.homelinux.net>
Thu, 8 Jan 2015 20:22:05 +0000 (15:22 -0500)
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

index e1834362791d85a725ec08caa93ff68b4d1ebbd7..df623112320bb41de4c5ecab1a1e29ed87e7dca9 100644 (file)
@@ -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