mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
ErrorLogger
ErrorLogger
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user