Skip to content

Commit

Permalink
[+] LogUnity
Browse files Browse the repository at this point in the history
  • Loading branch information
clansty committed Nov 29, 2024
1 parent 8a728ad commit bed1b85
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions AquaMai/AquaMai.Mods/Utils/LogUnity.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit bed1b85

Please sign in to comment.