mirror of
https://github.com/BepInEx/BepInEx.git
synced 2026-11-19 13:17:07 +00:00
Log Unity stack traces on IL2CPP (#1424)
UnityLogCallback ignored its second parameter, so Unity exceptions and errors logged only their message. Append the trace for Exception and Error when Unity gives one. The Mono source already does this for Exception. Log and Warning stay as they are, since in the game I tested Unity passed a trace for most of those. Fixes #660 Co-authored-by: mirfalltnixein <22786734+mirfalltnixein@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 file changed
+3
@@ -32,6 +32,9 @@ public class IL2CPPUnityLogSource : ILogSource
|
||||
LogType.Exception => LogLevel.Error,
|
||||
_ => LogLevel.Message
|
||||
};
|
||||
if (type is LogType.Exception or LogType.Error && !string.IsNullOrEmpty(exception))
|
||||
logLine += $"\nStack trace:\n{exception}";
|
||||
|
||||
LogEvent?.Invoke(this, new LogEventArgs(logLine, level, this));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user