turn off buffering on crash log, and log gc start/finish

This commit is contained in:
Damien Elmes 2017-01-13 20:56:24 +10:00
parent ed07a147f9
commit 864fbdf469

View file

@ -1180,14 +1180,16 @@ Please ensure a profile is open and Anki is not busy, then try again."""),
def doGC(self): def doGC(self):
assert not self.progress.inDB assert not self.progress.inDB
self._crashLog.write(b"gc started at %d\n" % time.time())
gc.collect() gc.collect()
self._crashLog.write(b"gc finished\n")
# Crash log # Crash log
########################################################################## ##########################################################################
def setupCrashLog(self): def setupCrashLog(self):
p = os.path.join(self.pm.base, "crash.log") p = os.path.join(self.pm.base, "crash.log")
self._crashLog = open(p, "a") self._crashLog = open(p, "ab", 0)
faulthandler.enable(self._crashLog) faulthandler.enable(self._crashLog)
# Media server # Media server