From 6ae165e30875feea9821508ac4b1e6fd2157bcdc Mon Sep 17 00:00:00 2001
From: MrGadget1024 <9826063+MrGadget1024@users.noreply.github.com>
Date: Fri, 9 Dec 2022 09:08:17 -0500
Subject: [PATCH] SimpleWebTransport - Added UNITY_SERVER around Exception
logging - don't need color tags on server
---
Assets/Mirror/Transports/SimpleWeb/Common/Log.cs | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/Assets/Mirror/Transports/SimpleWeb/Common/Log.cs b/Assets/Mirror/Transports/SimpleWeb/Common/Log.cs
index 3d4636f7c..ff2f3495f 100644
--- a/Assets/Mirror/Transports/SimpleWeb/Common/Log.cs
+++ b/Assets/Mirror/Transports/SimpleWeb/Common/Log.cs
@@ -80,7 +80,11 @@ public static void InfoException(Exception e)
if (level < Levels.info)
return;
+#if UNITY_SERVER
+ logger.Log(LogType.Log, $"[SimpleWebTransport] INFO_EXCEPTION: {e.GetType().Name} Message: {e.Message}\n{e.StackTrace}\n\n");
+#else
logger.Log(LogType.Log, $"[SimpleWebTransport] INFO_EXCEPTION: {e.GetType().Name} Message: {e.Message}\n{e.StackTrace}\n\n");
+#endif
}
[Conditional(SIMPLEWEB_LOG_ENABLED), Conditional(DEBUG)]
@@ -110,7 +114,11 @@ public static void Error(string msg, bool showColor = true)
public static void Exception(Exception e)
{
// always log Exceptions
+#if UNITY_SERVER
+ logger.Log(LogType.Error, $"[SimpleWebTransport] EXCEPTION: {e.GetType().Name} Message: {e.Message}\n{e.StackTrace}\n\n");
+#else
logger.Log(LogType.Error, $"[SimpleWebTransport] EXCEPTION: {e.GetType().Name} Message: {e.Message}\n{e.StackTrace}\n\n");
+#endif
}
}
}