mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
debuglog: Logger uses console to say mod so i gotta do that right
This commit is contained in:
parent
0e5a9c1668
commit
e8ed1053ec
@ -21,26 +21,24 @@ public static class DebugLog
|
|||||||
message = $"[{ProcessInstanceId}] " + message;
|
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
|
// copied from https://github.com/ow-mods/owml/blob/master/src/OWML.Logging/ModSocketOutput.cs#L33
|
||||||
|
Logger?.Log($"{type}: {message}");
|
||||||
|
|
||||||
|
_socket.WriteToSocket(new ModSocketMessage
|
||||||
{
|
{
|
||||||
var Logger = ModConsole.OwmlConsole.GetValue<IModLogger>("Logger");
|
SenderName = "QSB",
|
||||||
var _socket = ModConsole.OwmlConsole.GetValue<IModSocket>("_socket");
|
SenderType = GetCallingType(),
|
||||||
|
Type = type,
|
||||||
|
Message = message
|
||||||
|
});
|
||||||
|
|
||||||
Logger?.Log($"{type}: {message}");
|
if (type == MessageType.Fatal)
|
||||||
|
{
|
||||||
_socket.WriteToSocket(new ModSocketMessage
|
_socket.Close();
|
||||||
{
|
Process.GetCurrentProcess().Kill();
|
||||||
SenderName = "QSB",
|
|
||||||
SenderType = GetCallingType(),
|
|
||||||
Type = type,
|
|
||||||
Message = message
|
|
||||||
});
|
|
||||||
|
|
||||||
if (type == MessageType.Fatal)
|
|
||||||
{
|
|
||||||
_socket.Close();
|
|
||||||
Process.GetCurrentProcess().Kill();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user