Files
RAGECOOP-V/Client/Scripting/ResourceLogger.cs

29 lines
682 B
C#
Raw Normal View History

2023-02-27 11:54:02 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
namespace RageCoop.Client.Scripting
{
public class ResourceLogger : Core.Logger
{
public static readonly ResourceLogger Default = new();
public ResourceLogger()
{
2023-03-06 21:54:41 +08:00
FlushImmediately = true;
2023-02-27 11:54:02 +08:00
OnFlush += FlushToMainModule;
}
2023-03-06 21:54:41 +08:00
private unsafe void FlushToMainModule(LogLine line, string fomatted)
2023-02-27 11:54:02 +08:00
{
2023-03-06 21:54:41 +08:00
fixed (char* pMsg = line.Message)
{
APIBridge.LogEnqueue(line.LogLevel, pMsg);
}
2023-02-27 11:54:02 +08:00
}
}
}