/// <summary>
        /// Add log to the UnityDebugViewerEditor correspond to 'ADBForward'
        /// </summary>
        /// <param name="transferLogData"></param>
        private void AddTransferLog(TransferLogData transferLogData)
        {
            string editorMode = UnityDebugViewerDefaultMode.ADBForward;

            LogType type  = (LogType)transferLogData.logType;
            string  info  = transferLogData.info;
            string  stack = transferLogData.stack;

            UnityDebugViewerLogger.AddLog(info, stack, type, editorMode);
        }
Ejemplo n.º 2
0
 private void CaptureLogThread(string info, string stacktrace, UnityEngine.LogType type)
 {
     if (transfer == null)
     {
         return;
     }
     lock (transfer)
     {
         /// 将收集到的log数据序列化成byte[]
         /// 并转发至连接到指定端口的tcp client socket
         var    logData  = new TransferLogData(info, stacktrace, type);
         byte[] sendData = UnityDebugViewerTransferUtility.StructToBytes(logData);
         transfer.SendData(sendData);
     }
 }
        private void ReceiveDataFromServerHandler(byte[] data)
        {
            TransferLogData logData = UnityDebugViewerTransferUtility.BytesToStruct <TransferLogData>(data);

            AddTransferLog(logData);
        }