26 lines
603 B
C#
26 lines
603 B
C#
|
using System.Collections;
|
||
|
using System.Collections.Generic;
|
||
|
using UnityEngine;
|
||
|
|
||
|
public class LogHandler : MonoBehaviour
|
||
|
{
|
||
|
private void OnEnable()
|
||
|
{
|
||
|
Application.logMessageReceived += LogCallback;
|
||
|
}
|
||
|
|
||
|
private void LogCallback(string condition, string stackTrace, LogType type)
|
||
|
{
|
||
|
if (type == LogType.Exception)
|
||
|
{
|
||
|
System.Diagnostics.StackTrace sTrace = new System.Diagnostics.StackTrace();
|
||
|
Debug.LogError(sTrace.ToString());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
private void OnDisable()
|
||
|
{
|
||
|
Application.logMessageReceived -= LogCallback;
|
||
|
}
|
||
|
}
|