mirror of
https://github.com/dortania/OpenCore-Legacy-Patcher.git
synced 2026-04-14 04:38:20 +10:00
Add safe guards for logging
This commit is contained in:
@@ -64,6 +64,9 @@ class Analytics:
|
||||
return
|
||||
if not log_file.exists():
|
||||
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]
|
||||
|
||||
|
||||
@@ -228,7 +228,11 @@ class InitializeLoggingSupport:
|
||||
error_msg += f"\n\n{traceback.extract_tb(tb)[-1]}"
|
||||
|
||||
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:
|
||||
error_msg += "\n\nReveal log file?"
|
||||
|
||||
Reference in New Issue
Block a user