There should be a way to turn off the crash reporting logging at runtime - for example if the game is being modded we’d rather not receive any error logs at all instead of getting spammed by errors from the mods as it’s currently the case (making it hard to find reports caused by our own code).
Currently, there isn’t a way to turn off the logging at runtime.
Any news about this?
Any progress?
is an Editor only option from the looks of it. Is there no way to let players opt out of anonymous reporting?
I’ve setup
#if UNITY_EDITOR
using UnityEditor;
#endif
#if UNITY_EDITOR
[InitializeOnLoad]
public static class EditorQuit {
static void PlayChange(PlayModeStateChange state) {
if (state == PlayModeStateChange.ExitingPlayMode) {
UnityEditor.CrashReporting.CrashReportingSettings.enabled = true;
}
}
static EditorQuit() {
EditorApplication.playModeStateChanged += PlayChange;
}
}
#endif
to turn it on when I leave play mode, and similar in a Start() method to turn it off when I enter play in the editor, but it doesn’t solve the problem of runtime management.
Hi malkere,
I believe you are looking for CrashReportHandler.enableCaptureExceptions (Unity - Scripting API: CrashReportHandler.CrashReportHandler.enableCaptureExceptions). It is available at runtime and setting it to false will prevent exception reports from being sent.
1 Like
Awesome! Thank you emilyn