mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
Update
Update
This commit is contained in:
40
Assets/TEngine/Runtime/Utility/DefaultLogHelper.cs
Normal file
40
Assets/TEngine/Runtime/Utility/DefaultLogHelper.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace TEngine
|
||||
{
|
||||
/// <summary>
|
||||
/// 默认游戏框架日志辅助器。
|
||||
/// </summary>
|
||||
public class DefaultLogHelper : GameFrameworkLog.ILogHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 记录日志。
|
||||
/// </summary>
|
||||
/// <param name="level">日志等级。</param>
|
||||
/// <param name="message">日志内容。</param>
|
||||
public void Log(GameFrameworkLogLevel level, object message)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case GameFrameworkLogLevel.Debug:
|
||||
Debug.Log(Utility.Text.Format("<color=#888888>{0}</color>", message));
|
||||
break;
|
||||
|
||||
case GameFrameworkLogLevel.Info:
|
||||
Debug.Log(message.ToString());
|
||||
break;
|
||||
|
||||
case GameFrameworkLogLevel.Warning:
|
||||
Debug.LogWarning(message.ToString());
|
||||
break;
|
||||
|
||||
case GameFrameworkLogLevel.Error:
|
||||
Debug.LogError(message.ToString());
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new GameFrameworkException(message.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user