mirror of
https://github.com/MewoLab/AquaDX.git
synced 2026-02-09 16:27:32 +08:00
[+] LogUnity
This commit is contained in:
23
AquaMai/AquaMai.Mods/Utils/LogUnity.cs
Normal file
23
AquaMai/AquaMai.Mods/Utils/LogUnity.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using AquaMai.Config.Attributes;
|
||||||
|
using MelonLoader;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace AquaMai.Mods.Utils;
|
||||||
|
|
||||||
|
[ConfigSection(
|
||||||
|
en: "Output Unity logs (for debugging purposes)",
|
||||||
|
zh: "输出 Unity 日志(调试用)",
|
||||||
|
exampleHidden: true)]
|
||||||
|
public static class LogUnity
|
||||||
|
{
|
||||||
|
public static void OnBeforePatch()
|
||||||
|
{
|
||||||
|
Application.logMessageReceived += Log;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Log(string msg, string stackTrace, LogType type)
|
||||||
|
{
|
||||||
|
MelonLogger.Msg("[Unity] " + msg);
|
||||||
|
MelonLogger.Msg("[Unity] " + stackTrace);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user