debuglog: Logger uses console to say mod so i gotta do that right

This commit is contained in:
JohnCorby 2023-08-03 13:33:21 -07:00
parent 0e5a9c1668
commit e8ed1053ec

View File

@ -21,11 +21,10 @@ public static class DebugLog
message = $"[{ProcessInstanceId}] " + message;
}
var @this = QSBCore.Helper != null ? QSBCore.Helper.Console : ModConsole.OwmlConsole;
var Logger = @this.GetValue<IModLogger>("Logger");
var _socket = @this.GetValue<IModSocket>("_socket");
// copied from https://github.com/ow-mods/owml/blob/master/src/OWML.Logging/ModSocketOutput.cs#L33
{
var Logger = ModConsole.OwmlConsole.GetValue<IModLogger>("Logger");
var _socket = ModConsole.OwmlConsole.GetValue<IModSocket>("_socket");
Logger?.Log($"{type}: {message}");
_socket.WriteToSocket(new ModSocketMessage
@ -42,7 +41,6 @@ public static class DebugLog
Process.GetCurrentProcess().Kill();
}
}
}
public static void DebugWrite(string message, MessageType type = MessageType.Message)
{