SimpleWebTransport - Added UNITY_SERVER around Exception logging

- don't need color tags on server
This commit is contained in:
MrGadget1024 2022-12-09 09:08:17 -05:00
parent 33f1f95b8b
commit 6ae165e308

View File

@ -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: <color=cyan>{e.GetType().Name}</color> 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: <color=red>{e.GetType().Name}</color> Message: {e.Message}\n{e.StackTrace}\n\n");
#endif
}
}
}