mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-02-21 00:39:53 +00:00
hook Debug.Log calls
This commit is contained in:
parent
16051597df
commit
cb00fafa1c
@ -6,6 +6,7 @@ using QSB.Patches;
|
||||
using QSB.QuantumSync;
|
||||
using QSB.Utility;
|
||||
using QSB.WorldSync;
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@ -65,6 +66,17 @@ namespace QSB
|
||||
|
||||
DebugSettings = Helper.Storage.Load<DebugSettings>("debugsettings.json") ?? new DebugSettings();
|
||||
|
||||
Application.logMessageReceived += (condition, stackTrace, logType) =>
|
||||
DebugLog.DebugWrite($"[Debug] {condition} {stackTrace}", logType switch
|
||||
{
|
||||
LogType.Error => MessageType.Error,
|
||||
LogType.Assert => MessageType.Error,
|
||||
LogType.Warning => MessageType.Warning,
|
||||
LogType.Log => MessageType.Message,
|
||||
LogType.Exception => MessageType.Error,
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(logType), logType, null)
|
||||
});
|
||||
|
||||
InitializeAssemblies();
|
||||
|
||||
MenuApi = ModHelper.Interaction.GetModApi<IMenuAPI>(ModHelper.Manifest.Dependencies[0]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user