def _OnStart(cause: LoadingShared.LoadingCauses) -> None: global _preload, _loggingEnabled, _writeChronological, _writeGroups, _logLevel, _logInterval if cause != LoadingShared.LoadingCauses.Reloading: Patcher.Patch(log, "debug", _Debug) Patcher.Patch(log.Logger, "debug", _LoggerDebug) Patcher.Patch(log, "info", _Info) Patcher.Patch(log.Logger, "info", _LoggerInfo) Patcher.Patch(log, "warn", _Warning) Patcher.Patch(log.Logger, "warn", _LoggerWarning) Patcher.Patch(log, "error", _Error) Patcher.Patch(log.Logger, "error", _LoggerError) Patcher.Patch(log, "exception", _Exception) _UpdateSettings() Settings.RegisterOnUpdateCallback(_UpdateSettingsCallback) _preload = False _logger.Flush() Reporting.RegisterReportFileCollector(_DebugLogCollector)
def _OnStop(cause: LoadingShared.UnloadingCauses) -> None: global _exiting Settings.UnregisterOnUpdateCallback(_UpdateSettingsCallback) _logger.Flush() if cause == LoadingShared.UnloadingCauses.Exiting: _exiting = True Reporting.UnregisterReportFileCollector(_DebugLogCollector)
def dialogCallback(closedDialog: ui_dialog.UiDialog) -> None: try: if closedDialog.response == gameUserDataReportResponseID: Reporting.PrepareReportFiles(gameUserDataReportFilePath) _ShowReportCreatedDialog() elif closedDialog.response == desktopReportResponseID: Reporting.PrepareReportFiles(desktopReportFilePath) _ShowReportCreatedDialog() except: commands.CheatOutput( _connection )("Failed to run the callback for the prepare report location dialog." ) Debug.Log( "Failed to run the callback for the prepare report location dialog.", This.Mod.Namespace, Debug.LogLevels.Exception, group=This.Mod.Namespace, owner=__name__)
def _OnStop(cause: LoadingShared.UnloadingCauses) -> None: Reporting.UnregisterReportFileCollector(_GameFileStructureCollector)
def _OnStart(cause: LoadingShared.LoadingCauses) -> None: Reporting.RegisterReportFileCollector(_GameFileStructureCollector)
def _OnStart(cause: LoadingShared.LoadingCauses) -> None: Reporting.RegisterReportFileCollector(_PersistentCollector)
def _OnStop(cause: LoadingShared.UnloadingCauses) -> None: Reporting.UnregisterReportFileCollector(_PersistentCollector)
def _OnStart(cause: LoadingShared.LoadingCauses) -> None: Reporting.RegisterReportFileCollector(_DebugLogCollector)