Example #1
0
        /// <summary>
        /// Triggered when a new entry is added in the debug log.
        /// </summary>
        /// <param name="type">Type of the message.</param>
        /// <param name="message">Message string.</param>
        private void OnEntryAdded(DebugMessageType type, string message)
        {
            // Check if compiler message or reported exception, otherwise parse it as a normal log message
            ParsedLogEntry logEntry = ScriptCodeManager.ParseCompilerMessage(message);

            if (logEntry == null)
            {
                logEntry = Debug.ParseExceptionMessage(message);
            }

            if (logEntry == null)
            {
                logEntry = Debug.ParseLogMessage(message);
            }

            ConsoleEntryData newEntry = new ConsoleEntryData();

            newEntry.type      = type;
            newEntry.callstack = logEntry.callstack;
            newEntry.message   = logEntry.message;

            entries.Add(newEntry);

            if (DoesFilterMatch(type))
            {
                listView.AddEntry(newEntry);
                filteredEntries.Add(newEntry);
            }
        }
        /// <summary>
        /// Triggered when a new entry is added in the debug log.
        /// </summary>
        /// <param name="message">Message string.</param>
        /// <param name="verbosity">Verbosity level defining message importance.</param>
        /// <param name="category">Category of the sub-system reporting the message.</param>
        private void OnEntryAdded(string message, LogVerbosity verbosity, int category)
        {
            // Check if compiler message or reported exception, otherwise parse it as a normal log message
            ParsedLogEntry logEntry = ScriptCodeManager.ParseCompilerMessage(message);

            if (logEntry == null)
            {
                logEntry = Debug.ParseExceptionMessage(message);
            }

            if (logEntry == null)
            {
                logEntry = Debug.ParseLogMessage(message);
            }

            ConsoleEntryData newEntry = new ConsoleEntryData();

            newEntry.verbosity = verbosity;
            newEntry.category  = category;
            newEntry.callstack = logEntry.callstack;
            newEntry.message   = logEntry.message;

            entries.Add(newEntry);

            if (DoesFilterMatch(verbosity))
            {
                listView.AddEntry(newEntry);
                filteredEntries.Add(newEntry);
            }
        }