Exemplo n.º 1
0
    /// <summary>
    /// 打印一条错误日志
    /// </summary>
    /// <param name="msgObj"></param>
    /// <param name="context"></param>
    public static void LogError(params object[] args)
    {
        string msgText = StringBuilderContent(args);

        ///目的是为了避免相同的日志输出
        if (string.IsNullOrEmpty(mstrLastFileLog))
        {
            mstrLastFileLog = msgText;
        }
        else
        {
            if (mstrLastFileLog.Equals(msgText))
            {
                return;
            }
            mstrLastFileLog = msgText;
        }

#if UNITY_IPHONE && !UNITY_EDITOR
        IOSInterface.U3DLog(msgText);
#endif

        UnityEngine.Debug.LogError(msgText, null);
        if (mbFileLog)
        {
            TraceFile(2, msgText);
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 打印一条信息日志
    /// </summary>
    /// <param name="msgText">文本记录</param>
    /// <param name="context">错误对象</param>
    public static void Log(params object[] args)
    {
        string msgText = StringBuilderContent(args);

        if (mbDebugLog)
        {
            UnityEngine.Debug.Log(msgText, null);
        }

        if (mbFileLog)
        {
            TraceFile(0, msgText);
        }

#if UNITY_IPHONE && !UNITY_EDITOR
        msgText = StringBuilderContent(args);
        IOSInterface.U3DLog(msgText);
#endif
    }