private void Log(string _tagName, object _message, eConsoleLogType _logType, UnityEngine.Object _context, int _skipStackFrameCount = 1) { // Do I need to ignore this call if (IgnoreConsoleLog(_tagName)) { return; } // Add additional skip frame _skipStackFrameCount++; int _tagID = GetIndexOfConsoleTag(_tagName); // When we cant find our tag, add a new entry if (_tagID == -1) { m_consoleTags.Add(new ConsoleTag(_tagName)); // And update tag-ID _tagID = m_consoleTags.Count - 1; } ConsoleTag _consoleLogTag = m_consoleTags[_tagID]; // Marked to ignore this log if (_consoleLogTag.Ignore) { return; } int _logID = m_consoleLogsList.Count + 1; ConsoleLog _newConsoleLog = new ConsoleLog(_logID, _tagID, _message.ToString(), _logType, _context, _skipStackFrameCount); #if UNITY_EDITOR // Add this new console to list of logs m_consoleLogsList.Add(_newConsoleLog); // Add it to display list bool _addSuccess = AddToDisplayableLogList(_newConsoleLog); if (_addSuccess) { // Pause unity player on error if (_logType != eConsoleLogType.INFO && _logType != eConsoleLogType.WARNING) { if (m_errorPause) { EditorApplication.isPaused = true; } } } // Set as modified EditorUtility.SetDirty(this); #else NativeBinding.Log(_newConsoleLog); #endif }
public ConsoleLog(int _logID, int _tagID, string _message, eConsoleLogType _type, UnityEngine.Object _context) : this() { // Set console log details ID = _logID; TagID = _tagID; Message = _message; Type = _type; Context = _context; ExtractStackTraceDescription(); }
#pragma warning restore #endregion #region Constructor public ConsoleLog(int _logID, int _tagID, string _message, eConsoleLogType _type, UnityEngine.Object _context, int _skipFrames) : this() { // Set console log details ID = _logID; TagID = _tagID; Message = _message; Type = _type; Context = _context; // Collect information using stacktrace // Using skipframes to reach out to the exact callers StackTrace _stackTrace = new StackTrace(++_skipFrames, true); StackFrame _firstFrame = _stackTrace.GetFrame(0); m_callerFileName = _firstFrame.GetFileName(); m_callerFileLineNumber = _firstFrame.GetFileLineNumber(); // Collect description CollectStackTraceInfo(_stackTrace); // Description Description = Message + "\n" + StackTrace; }
private static extern void debugProLogMessage (string _message, eConsoleLogType _type, string _stackTrace);
private void Log (string _tagName, object _message, eConsoleLogType _logType, UnityEngine.Object _context, int _skipStackFrameCount = 1) { // Do I need to ignore this call if (IgnoreConsoleLog(_tagName)) return; // Add additional skip frame _skipStackFrameCount++; int _tagID = GetIndexOfConsoleTag(_tagName); // When we cant find our tag, add a new entry if (_tagID == -1) { m_consoleTags.Add(new ConsoleTag(_tagName)); // And update tag-ID _tagID = m_consoleTags.Count - 1; } ConsoleTag _consoleLogTag = m_consoleTags[_tagID]; // Marked to ignore this log if (_consoleLogTag.Ignore) return; int _logID = m_consoleLogsList.Count + 1; ConsoleLog _newConsoleLog = new ConsoleLog(_logID, _tagID, _message.ToString(), _logType, _context, _skipStackFrameCount); #if UNITY_EDITOR // Add this new console to list of logs m_consoleLogsList.Add(_newConsoleLog); // Add it to display list bool _addSuccess = AddToDisplayableLogList(_newConsoleLog); if (_addSuccess) { // Pause unity player on error if (_logType != eConsoleLogType.INFO && _logType != eConsoleLogType.WARNING) { if (m_errorPause) { EditorApplication.isPaused = true; } } } // Set as modified EditorUtility.SetDirty(this); #else NativeBinding.Log(_newConsoleLog); #endif }
private static extern void debugProLogMessage(string _message, eConsoleLogType _type, string _stackTrace);
#pragma warning restore #endregion #region Constructor public ConsoleLog (int _logID, int _tagID, string _message, eConsoleLogType _type, UnityEngine.Object _context, int _skipFrames) : this () { // Set console log details ID = _logID; TagID = _tagID; Message = _message; Type = _type; Context = _context; // Collect information using stacktrace // Using skipframes to reach out to the exact callers StackTrace _stackTrace = new StackTrace(++_skipFrames, true); StackFrame _firstFrame = _stackTrace.GetFrame(0); m_callerFileName = _firstFrame.GetFileName(); m_callerFileLineNumber = _firstFrame.GetFileLineNumber(); // Collect description CollectStackTraceInfo(_stackTrace); // Description Description = Message + "\n" + StackTrace; }