Support crash logging in CLI code

This commit is contained in:
Mykola Grymalyuk
2023-05-30 15:42:17 -06:00
parent 47be068aaf
commit 831495923a
4 changed files with 9 additions and 1 deletions

View File

@@ -48,7 +48,7 @@ class CreateBinary:
""" """
os.chdir(Path(__file__).resolve().parent) os.chdir(Path(__file__).resolve().parent)
print(f"Current Working Directory: \n\t{os.getcwd()}") print(f"Current Working Directory:\n- {os.getcwd()}")
def _parse_arguments(self): def _parse_arguments(self):

View File

@@ -213,6 +213,7 @@ class InitializeLoggingSupport:
self._display_debug_properties() self._display_debug_properties()
if self.constants.cli_mode is True: if self.constants.cli_mode is True:
threading.Thread(target=analytics_handler.Analytics(self.constants).send_crash_report, args=(self.log_filepath,)).start()
return return
error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n" error_msg = f"OpenCore Legacy Patcher encountered the following internal error:\n\n"

View File

@@ -52,6 +52,10 @@ class EntryPoint:
patches = sys_patch_detect.DetectRootPatch(self.constants.computer.real_model, self.constants).detect_patch_set() patches = sys_patch_detect.DetectRootPatch(self.constants.computer.real_model, self.constants).detect_patch_set()
logging.info(f"Entry point set: {entry.__name__}") logging.info(f"Entry point set: {entry.__name__}")
# Normally set by main.py, but transitions from CLI mode may not have this set
self.constants.gui_mode = True
self.frame: wx.Frame = entry( self.frame: wx.Frame = entry(
None, None,
title=f"{self.constants.patcher_name} ({self.constants.patcher_version})", title=f"{self.constants.patcher_name} ({self.constants.patcher_version})",

View File

@@ -52,6 +52,9 @@ class UpdateFrame(wx.Frame):
version_label = dict[key]["Version"] version_label = dict[key]["Version"]
url = dict[key]["Link"] url = dict[key]["Link"]
break break
else:
wx.MessageBox("Failed to get update info", "Critical Error")
sys.exit(1)
self.version_label = version_label self.version_label = version_label
self.url = url self.url = url