(client)chore:将维度区分独立,将加载页面独立,降低代码耦合,写了更好看的注释
This commit is contained in:
17
Client/Assets/Scripts/Logging/LoggerManagerWrapper.cs
Normal file
17
Client/Assets/Scripts/Logging/LoggerManagerWrapper.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using Managers;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Logging
|
||||
{
|
||||
public class LoggerManagerWrapper : ILaunchManager
|
||||
{
|
||||
public string StepDescription => "初始化日志";
|
||||
public void Init()
|
||||
{
|
||||
Logging.UnityLogger.Init();
|
||||
}
|
||||
public void Clear()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffa9f8b447ee49f486398248d438f7ca
|
||||
timeCreated: 1756128101
|
@ -9,10 +9,13 @@ namespace Logging
|
||||
private static readonly SerilogLogger Logger = new LoggerConfiguration()
|
||||
.WriteTo.File("Logs/UnityLog.txt")
|
||||
.CreateLogger();
|
||||
|
||||
private static bool _initialized = false;
|
||||
public static void Init()
|
||||
{
|
||||
if(_initialized)
|
||||
return;
|
||||
Application.logMessageReceived += OnLogMessageReceived;
|
||||
_initialized = true;
|
||||
}
|
||||
|
||||
private static void OnLogMessageReceived(string logString, string stackTrace, LogType type)
|
||||
|
Reference in New Issue
Block a user