private static void OnLogMessageReceived(string logString, string stack, LogType type)
    {
        if (type == LogType.Exception && logUnhandledExceptionAsCrash)
        {
            return;
        }
        string text = $"{Crittercism.stripTimestamps(logString)}\r\n{stack}";

        switch (type)
        {
        case LogType.Exception:
            if (stack.Contains("UnityEngine.Debug:LogException("))
            {
                logger.LogHandledExceptionMessage(text);
            }
            else
            {
                logger.LogUnhandledException(text);
            }
            break;

        case LogType.Error:
        case LogType.Assert:
            logger.LogError(text);
            break;

        case LogType.Warning:
        case LogType.Log:
            break;
        }
    }
    public static string StackTrace(Exception e)
    {
        string           text = e.StackTrace;
        List <Exception> list = new List <Exception>();

        list.Add(e);
        if (text != null)
        {
            Exception innerException = e.InnerException;
            while (innerException != null && list.IndexOf(innerException) < 0)
            {
                list.Add(innerException);
                text           = innerException.GetType().FullName + " : " + innerException.Message + "\r\n" + innerException.StackTrace + "\r\n" + text;
                innerException = innerException.InnerException;
            }
        }
        else
        {
            text = "";
        }
        return(Crittercism.stripTimestamps(text));
    }