mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-03 17:38:30 +00:00
make debug log hook a setting
This commit is contained in:
parent
cb00fafa1c
commit
1885ab201d
@ -66,16 +66,19 @@ namespace QSB
|
|||||||
|
|
||||||
DebugSettings = Helper.Storage.Load<DebugSettings>("debugsettings.json") ?? new DebugSettings();
|
DebugSettings = Helper.Storage.Load<DebugSettings>("debugsettings.json") ?? new DebugSettings();
|
||||||
|
|
||||||
Application.logMessageReceived += (condition, stackTrace, logType) =>
|
if (DebugSettings.HookDebugLogs)
|
||||||
DebugLog.DebugWrite($"[Debug] {condition} {stackTrace}", logType switch
|
{
|
||||||
{
|
Application.logMessageReceived += (condition, stackTrace, logType) =>
|
||||||
LogType.Error => MessageType.Error,
|
DebugLog.DebugWrite($"[Debug] {condition} {stackTrace}", logType switch
|
||||||
LogType.Assert => MessageType.Error,
|
{
|
||||||
LogType.Warning => MessageType.Warning,
|
LogType.Error => MessageType.Error,
|
||||||
LogType.Log => MessageType.Message,
|
LogType.Assert => MessageType.Error,
|
||||||
LogType.Exception => MessageType.Error,
|
LogType.Warning => MessageType.Warning,
|
||||||
_ => throw new ArgumentOutOfRangeException(nameof(logType), logType, null)
|
LogType.Log => MessageType.Message,
|
||||||
});
|
LogType.Exception => MessageType.Error,
|
||||||
|
_ => throw new ArgumentOutOfRangeException(nameof(logType), logType, null)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
InitializeAssemblies();
|
InitializeAssemblies();
|
||||||
|
|
||||||
|
@ -13,6 +13,9 @@ namespace QSB.Utility
|
|||||||
[JsonProperty("playerIdInLogs")]
|
[JsonProperty("playerIdInLogs")]
|
||||||
public bool PlayerIdInLogs;
|
public bool PlayerIdInLogs;
|
||||||
|
|
||||||
|
[JsonProperty("hookDebugLogs")]
|
||||||
|
public bool HookDebugLogs;
|
||||||
|
|
||||||
[JsonProperty("debugMode")]
|
[JsonProperty("debugMode")]
|
||||||
public bool DebugMode;
|
public bool DebugMode;
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
"useKcpTransport": false,
|
"useKcpTransport": false,
|
||||||
"dumpWorldObjects": false,
|
"dumpWorldObjects": false,
|
||||||
"playerIdInLogs": false,
|
"playerIdInLogs": false,
|
||||||
|
"hookDebugLogs": false,
|
||||||
"debugMode": false,
|
"debugMode": false,
|
||||||
"drawGui": false,
|
"drawGui": false,
|
||||||
"drawLines": false,
|
"drawLines": false,
|
||||||
|
Loading…
Reference in New Issue
Block a user