private static void ProcessExceptionReport(string message, string stackTrace, LogType type) { Mogo.Util.LogLevel dEBUG = Mogo.Util.LogLevel.DEBUG; switch (type) { case LogType.Error: dEBUG = Mogo.Util.LogLevel.ERROR; break; case LogType.Assert: dEBUG = Mogo.Util.LogLevel.DEBUG; break; case LogType.Warning: dEBUG = Mogo.Util.LogLevel.WARNING; break; case LogType.Log: dEBUG = Mogo.Util.LogLevel.DEBUG; break; case LogType.Exception: dEBUG = Mogo.Util.LogLevel.EXCEPT; break; } if (dEBUG == (CurrentLogLevels & dEBUG)) { Log(string.Concat(new object[] { " [SYS_", dEBUG, "]: ", message, '\n', stackTrace }), dEBUG, false); } }
public void WriteLog(string msg, Mogo.Util.LogLevel level, bool writeEditorLog) { if (Application.platform == RuntimePlatform.IPhonePlayer) { this.m_logWriter(msg, level, writeEditorLog); } else { this.m_logWriter.BeginInvoke(msg, level, writeEditorLog, null, null); } }
private void Write(string msg, Mogo.Util.LogLevel level, bool writeEditorLog) { object obj2; Monitor.Enter(obj2 = m_locker); try { if (!writeEditorLog) { goto Label_0066; } Mogo.Util.LogLevel level2 = level; if (level2 <= Mogo.Util.LogLevel.ERROR) { switch (level2) { case Mogo.Util.LogLevel.DEBUG: case Mogo.Util.LogLevel.INFO: Debug.Log(msg); break; case Mogo.Util.LogLevel.WARNING: Debug.LogWarning(msg); break; case Mogo.Util.LogLevel.ERROR: goto Label_005A; } goto Label_0066; } if ((level2 != Mogo.Util.LogLevel.EXCEPT) && (level2 != Mogo.Util.LogLevel.CRITICAL)) { goto Label_0066; } Label_005A: Debug.LogError(msg); Label_0066: if (this.m_sw != null) { this.m_sw.WriteLine(msg); this.m_sw.Flush(); } } catch (Exception exception) { Debug.LogError(exception.Message); } finally { Monitor.Exit(obj2); } }
private static void Log(string message, Mogo.Util.LogLevel level, bool writeEditorLog = true) { string msg = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss,fff") + message; m_logWriter.WriteLog(msg, level, writeEditorLog); }