Files
TEngine/Assets/GameScripts/HotFix/GameLogic/ErrorLogger/ErrorLogger.cs
ALEXTANG 033cd12bc8 ErrorLogger
ErrorLogger
2023-04-18 17:07:11 +08:00

26 lines
628 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using UnityEngine;
namespace GameLogic
{
public class ErrorLogger
{
public ErrorLogger()
{
Application.logMessageReceived += LogHandler;
}
~ErrorLogger()
{
Application.logMessageReceived -= LogHandler;
}
private void LogHandler(string condition, string stacktrace, LogType type)
{
if (type == LogType.Exception)
{
string des = $"客户端报错, \n#内容#---{condition} \n#位置#---{stacktrace}";
GameModule.UI.ShowUI<LogUI>(des);
}
}
}
}