#pragma warning restore 168


        public static List <UCL_LogInfo> GetLog(int startIndex = 0)
        {
            List <UCL_LogInfo> currentOutput = new List <UCL_LogInfo> ();



            var m     = Entries.GetMethod("GetEntryInternal", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);
            var start = Entries.GetMethod("StartGettingEntries", System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public);

            start.Invoke(null, null);

            int count = GetCount();

            for (int i = 0; i < count; i++)
            {
                if (i >= startIndex)
                {
                    var e = Activator.CreateInstance(Entry);
                    m.Invoke(null, new object[] { i, e });

                    FieldInfo field     = e.GetType().GetField("condition", BindingFlags.Instance | BindingFlags.Public);
                    string    condition = (string)field.GetValue(e);


                    /*	field = e.GetType().GetField("errorNum", BindingFlags.Instance | BindingFlags.Public);
                     * int errorNum = (int) field.GetValue(e);*/


                    field = e.GetType().GetField("instanceID", BindingFlags.Instance | BindingFlags.Public);
                    int instanceID = (int)field.GetValue(e);


                    field = e.GetType().GetField("mode", BindingFlags.Instance | BindingFlags.Public);
                    int mode = (int)field.GetValue(e);



                    UCL_LogInfo log = new UCL_LogInfo(i + 10, condition, mode, instanceID);
                    log.SetLineNumber(i);


                    currentOutput.Add(log);
                }
            }
            var end = Entries.GetMethod("EndGettingEntries", BindingFlags.Static | BindingFlags.Public);

            end.Invoke(null, null);



            return(currentOutput);
        }
예제 #2
0
		//--------------------------------------
		// Double Click Actions
		//--------------------------------------



		public static void JumpToSource(UCL_LogInfo log) {
			if(log.HasValidFilePointer) {
				JumpToSource (log.Pointer);
			}

			foreach(var stack in log.Stack) {

				if(!stack.HasValidFilePointer) {
					continue;
				}

				JumpToSource (stack.Pointer);
				break;
			}
		}
예제 #3
0
        public void SetLog(UCL_LogInfo log)
        {
            //We already had a log to show, and now we've been asked to show a new one
            //Let's check if that is the same one and if we have to drop selection
            if (log != null)
            {
                if (m_log != null)
                {
                    if (m_lastLogID != log.Id)
                    {
                        m_treeView.SetSelection(new List <int>());
                    }
                }

                m_lastLogID = log.Id;
            }

            m_log = log;
            m_treeView.Build(m_log);
        }
예제 #4
0
		//--------------------------------------
		// Right Click Actions
		//--------------------------------------


		public static void ShowLogLineMenu(UCL_LogInfo log) {
			GenericMenu toolsMenu = new GenericMenu();
			toolsMenu.AddItem (new GUIContent ("Copy"), false, () => {
				EditorGUIUtility.systemCopyBuffer = log.LogString;
				//LoggerWindow.Instance.ShowNotification( new GUIContent("Copied To Clipboard"));
			});

			toolsMenu.AddItem (new GUIContent ("Copy with Stack Trace"), false, () => {

				string fullLog = log.LogString  + "\n";

				foreach(var line in log.Stack) {
					fullLog+= line.RawData + "\n";
				}

				EditorGUIUtility.systemCopyBuffer = fullLog;
				//LoggerWindow.Instance.ShowNotification( new GUIContent("Copied To Clipboard"));

			});

			toolsMenu.ShowAsContext();
		}
예제 #5
0
 public void Build(UCL_LogInfo log)
 {
     m_log = log;
     Reload();
 }
예제 #6
0
 public UCL_TreeViewItem(UCL_LogInfo log) : base(log.Id, 0, log.LogString)
 {
     m_logInfo = log;
 }