Skip to content

Commit bed1b85

Browse files
committed
[+] LogUnity
1 parent 8a728ad commit bed1b85

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
using AquaMai.Config.Attributes;
2+
using MelonLoader;
3+
using UnityEngine;
4+
5+
namespace AquaMai.Mods.Utils;
6+
7+
[ConfigSection(
8+
en: "Output Unity logs (for debugging purposes)",
9+
zh: "输出 Unity 日志(调试用)",
10+
exampleHidden: true)]
11+
public static class LogUnity
12+
{
13+
public static void OnBeforePatch()
14+
{
15+
Application.logMessageReceived += Log;
16+
}
17+
18+
private static void Log(string msg, string stackTrace, LogType type)
19+
{
20+
MelonLogger.Msg("[Unity] " + msg);
21+
MelonLogger.Msg("[Unity] " + stackTrace);
22+
}
23+
}

0 commit comments

Comments
 (0)