mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-06-20 22:20:53 +10:00
Add safe guards for logging
This commit is contained in:
@@ -64,6 +64,9 @@ class Analytics:
|
|||||||
return
|
return
|
||||||
if not log_file.exists():
|
if not log_file.exists():
|
||||||
return
|
return
|
||||||
|
if self.constants.commit_info[0].startswith("refs/tags"):
|
||||||
|
# Avoid being overloaded with crash reports
|
||||||
|
return
|
||||||
|
|
||||||
commit_info = self.constants.commit_info[0].split("/")[-1] + "_" + self.constants.commit_info[1].split("T")[0] + "_" + self.constants.commit_info[2].split("/")[-1]
|
commit_info = self.constants.commit_info[0].split("/")[-1] + "_" + self.constants.commit_info[1].split("T")[0] + "_" + self.constants.commit_info[2].split("/")[-1]
|
||||||
|
|
||||||
|
|||||||
@@ -228,7 +228,11 @@ class InitializeLoggingSupport:
|
|||||||
error_msg += f"\n\n{traceback.extract_tb(tb)[-1]}"
|
error_msg += f"\n\n{traceback.extract_tb(tb)[-1]}"
|
||||||
|
|
||||||
cant_log: bool = global_settings.GlobalEnviromentSettings().read_property("DisableCrashAndAnalyticsReporting")
|
cant_log: bool = global_settings.GlobalEnviromentSettings().read_property("DisableCrashAndAnalyticsReporting")
|
||||||
|
if not isinstance(cant_log, bool):
|
||||||
|
cant_log = False
|
||||||
|
|
||||||
|
if self.constants.commit_info[0].startswith("refs/tags"):
|
||||||
|
cant_log = True
|
||||||
|
|
||||||
if cant_log is True:
|
if cant_log is True:
|
||||||
error_msg += "\n\nReveal log file?"
|
error_msg += "\n\nReveal log file?"
|
||||||
|
|||||||
Reference in New Issue
Block a user