Quantcast
Channel: Questions in topic: "exception"
Viewing all articles
Browse latest Browse all 470

Is there any way to handle Exception without outputting as log.

$
0
0
Hi, I'd like to send message to server when exception occurred in release build. My code is below. class RuntimeInitialize { [RuntimeInitializeOnLoadMethod] static void OnRuntimeMethod() { #if DEBUG UnityEngine.Debug.logger.filterLogType = UnityEngine.LogType.Log; #else UnityEngine.Debug.logger.filterLogType = UnityEngine.LogType.Exception; #endif Application.logMessageReceived += OnLogRecieved; } public static void OnLogRecieved(string logString, string stackTrace, LogType type) { if (type != LogType.Exception) return; SendExceptionMessageToServer(logString, stackTrace) } } This code can send Exception message to server, but output message to Logcat simultaneously. How to stop outputting to Logcat ? Thanks.

Viewing all articles
Browse latest Browse all 470

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>