Does anyone know of a way to force Error Pause option in the console window to be on when the game is run? Currently having issues with people not having this option set, thinking the changes they made didn’t break anything (because the game comes up fine for them) and then check these crashes into source control. I would ideally like to write a script that could force this option on if possible.
You could write a custom error log handler that automatically logs errors in the background. Something like this:
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
public string output = "";
public string stack = "";
void OnEnable() {
Application.logMessageReceived += HandleLog;
}
void OnDisable() {
Application.logMessageReceived -= HandleLog;
}
void HandleLog(string logString, string stackTrace, LogType type) {
if(type == LogType.Error) {
// code here to write logString and stackTrace
// to your error database
}
}
}