183 |
183 |
184 versionInfo = "\n{0}\n{1}".format( |
184 versionInfo = "\n{0}\n{1}".format( |
185 separator, Utilities.generateVersionInfo()) |
185 separator, Utilities.generateVersionInfo()) |
186 pluginVersionInfo = Utilities.generatePluginsVersionInfo() |
186 pluginVersionInfo = Utilities.generatePluginsVersionInfo() |
187 if pluginVersionInfo: |
187 if pluginVersionInfo: |
188 versionInfo += "{0}\n{1}".format(separator, pluginVersionInfo) |
188 versionInfo += "\n{0}\n{1}".format(separator, pluginVersionInfo) |
189 distroInfo = Utilities.generateDistroInfo() |
189 distroInfo = Utilities.generateDistroInfo() |
190 if distroInfo: |
190 if distroInfo: |
191 versionInfo += "{0}\n{1}".format(separator, distroInfo) |
191 versionInfo += "\n{0}\n{1}".format(separator, distroInfo) |
192 |
192 |
193 if isinstance(excType, str): |
193 if isinstance(excType, str): |
194 tbinfo = tracebackobj |
194 tbinfo = tracebackobj |
195 else: |
195 else: |
196 tbinfofile = io.StringIO() |
196 tbinfofile = io.StringIO() |
197 traceback.print_tb(tracebackobj, None, tbinfofile) |
197 traceback.print_tb(tracebackobj, None, tbinfofile) |
198 tbinfofile.seek(0) |
198 tbinfofile.seek(0) |
199 tbinfo = tbinfofile.read() |
199 tbinfo = tbinfofile.read() |
200 errmsg = '{0}: \n{1}'.format(str(excType), str(excValue)) |
200 errmsg = '{0}: \n{1}'.format(str(excType), str(excValue)) |
201 sections = [separator, timeString, separator, errmsg, separator, tbinfo] |
201 sections = ['', separator, timeString, separator, errmsg, separator, |
|
202 tbinfo] |
202 msg = '\n'.join(sections) |
203 msg = '\n'.join(sections) |
203 try: |
204 try: |
204 f = open(logFile, "w", encoding="utf-8") |
205 f = open(logFile, "w", encoding="utf-8") |
205 f.write(msg) |
206 f.write(msg) |
206 f.write(versionInfo) |
207 f.write(versionInfo) |