using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class debugs : MonoBehaviour
{
public string logs;
// Start is called before the first frame update
void Awake()
{
Application.logMessageReceived += HandleLog;
}
///
/// Debug 对应的回调处理
///
/// 信息.
/// 信息的来源
/// 信息类型 (error, exception, warning, assert).
private void HandleLog(string message, string stackTrace, LogType type)
{
string _color = "white";
if (type == LogType.Assert)
_color = "white";
if (type == LogType.Error)
_color = "red";
if (type == LogType.Exception)
_color = "magenta";
if (type == LogType.Log)
_color = "green";
if (type == LogType.Warning)
_color = "yellow";
logs = logs + "" + message + "n";
}
}