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.
↧