예제 #1
0
        private LogcatEntry ParseLogEntry(Match m)
        {
            DateTime dateTime;
            var      dateValue = m.Groups["date"].Value;

            if (LogPrintFormat == kThreadTime)
            {
                dateValue = "1999-" + dateValue;
            }

            try
            {
                dateTime = DateTime.Parse(dateValue);
            }
            catch (Exception ex)
            {
                dateTime = new DateTime();
                AndroidLogcatInternalLog.Log("Failed to parse date: " + dateValue + "\n" + ex.Message);
            }

            var entry = new LogcatEntry(
                dateTime,
                Int32.Parse(m.Groups["pid"].Value),
                Int32.Parse(m.Groups["tid"].Value),
                PriorityStringToEnum(m.Groups["priority"].Value),
                m.Groups["tag"].Value,
                m.Groups["msg"].Value);

            return(entry);
        }
예제 #2
0
 public LogcatEntry(LogcatEntry entry)
 {
     this.dateTime  = entry.dateTime;
     this.processId = entry.processId;
     this.threadId  = entry.threadId;
     this.priority  = entry.priority;
     this.tag       = entry.tag;
     this.message   = entry.message;
 }
예제 #3
0
        private void TryToOpenFileFromLogEntry(LogcatEntry entry)
        {
            Regex re    = new Regex(@"at.*\s([^\s]+):(\d+)");
            var   match = re.Match(entry.message);

            if (match.Success)
            {
                UnityEditorInternal.InternalEditorUtility.TryOpenErrorFileFromConsole(match.Groups[1].Value, Int32.Parse(match.Groups[2].Value));
            }
        }
예제 #4
0
        public AndroidLogcat(AndroidLogcatRuntimeBase runtime, AndroidBridge.ADB adb, IAndroidLogcatDevice device, int packagePid, Priority priority, string filter, bool filterIsRegex, string[] tags)
        {
            this.m_Runtime         = runtime;
            this.adb               = adb;
            this.m_Device          = device;
            this.m_PackagePid      = packagePid;
            this.m_MessagePriority = priority;
            this.m_FilterIsRegex   = filterIsRegex;
            InitFilterRegex(filter);
            this.m_Tags = tags;

            LogcatEntry.SetTimeFormat(m_Device.SupportYearFormat ? LogcatEntry.kTimeFormatWithYear : LogcatEntry.kTimeFormatWithoutYear);
        }