HaoYueTunnel/ClientCore/Manager/LogManager.cs

49 lines
1.0 KiB
C#
Raw Permalink Normal View History

2023-05-25 18:30:22 +08:00
namespace ClientCore.Manager
{
public class LogManager
{
2024-04-26 17:51:55 +08:00
public enum E_LogType : byte
{
Info = 0,
Debug = 1,
Warning = 2,
Error = 3,
}
/// <summary>
/// 日志
/// </summary>
/// <param name="sk"></param>
public delegate void OnLogHandler(int debuglv, string msg);
/// <summary>
/// 内部输出
/// </summary>
public static event OnLogHandler OnLog;
public void Info(string str)
{
Log(E_LogType.Info, str);
}
2023-05-25 18:30:22 +08:00
public void Debug(string str)
{
2024-04-26 17:51:55 +08:00
Log(E_LogType.Debug, str);
2023-05-25 18:30:22 +08:00
}
public void Warning(string str)
{
2024-04-26 17:51:55 +08:00
Log(E_LogType.Warning, str);
2023-05-25 18:30:22 +08:00
}
public void Error(string str)
{
2024-04-26 17:51:55 +08:00
Log(E_LogType.Error, str);
}
public void Log(E_LogType logtype, string str)
{
OnLog?.Invoke((int)logtype, str);
2023-05-25 18:30:22 +08:00
}
}
}