34 lines
782 B
C#
34 lines
782 B
C#
using System;
|
|
|
|
namespace StandardScene.Fass2Simulator
|
|
{
|
|
public static class Fass2SimLog
|
|
{
|
|
public static event Action<string> MessageWritten;
|
|
|
|
public static void WriteLine(string message)
|
|
{
|
|
if (string.IsNullOrEmpty(message))
|
|
{
|
|
return;
|
|
}
|
|
|
|
Fass2SimFileLogger.Write(message);
|
|
MessageWritten?.Invoke(message);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 高频日志只写文件,避免 UI 线程被 BeginInvoke 淹没。
|
|
/// </summary>
|
|
public static void WriteFileOnly(string message)
|
|
{
|
|
if (string.IsNullOrEmpty(message))
|
|
{
|
|
return;
|
|
}
|
|
|
|
Fass2SimFileLogger.Write(message);
|
|
}
|
|
}
|
|
}
|