private void Add_Error(string format, params object[] args) { string str = DebugHud.Format_Log(format, 1, args); Errors.Add(str); SLog.Info("[ <b>{0}</b> ] {1}", this.dll_name, str); onError?.Invoke(); }
public static string Format_Exception_Log(Exception ex, int stack_offset = 0) { string str = null; try { //string trace = new StackTrace(ex, 1 + stack_offset, true).ToString(); string trace = StackTraceUtility.ExtractStringFromException(ex); str = String.Format("{0}\n{1}", ex.Message, trace); } catch (Exception e) { write_log("DebugHUD.Format_Exception_Log() THREW AN INTERNAL EXCEPTION!\n{0}\n{1}", e.Message, e.StackTrace); str = String.Format("{0}\n{1}", ex.Message, StackTraceUtility.ExtractStackTrace()); } if (ex.InnerException != null) { str = String.Format("{0}\n{1}", str, ex.InnerException.Message); } return(DebugHud.Format_Log(str, 2 + stack_offset));//reformat our exception string with an additional stack offset of 1 to make it skip past the function that called THIS format function. //return DebugHud.Tag_String(str, stack_offset); }
public static void LogSilent(string format, params object[] args) { string str = DebugHud.Format_Log(format, 1, args); DebugHud.write_log(str); }