public static void Exception(string message, Exception exception) { if (!exception.StackTrace.Contains("Oxide.Core") && !exception.StackTrace.Contains("Oxide.Plugins.Compiler")) { return; } string[] exceptionFilter = RemoteLogger.ExceptionFilter; for (int i = 0; i < (int)exceptionFilter.Length; i++) { string str = exceptionFilter[i]; if (exception.StackTrace.Contains(str) || message.Contains(str)) { return; } } RemoteLogger.EnqueueReport("fatal", Assembly.GetCallingAssembly(), RemoteLogger.GetCurrentMethod(), message, exception.ToString()); }
private static void SubmitNextReport() { if (RemoteLogger.QueuedReports.Count < 1) { return; } RemoteLogger.QueuedReport item = RemoteLogger.QueuedReports[0]; RemoteLogger.submittingReports = true; RemoteLogger.Webrequests.Enqueue(RemoteLogger.Url, item.Body, (int code, string response) => { if (code == 200) { RemoteLogger.QueuedReports.RemoveAt(0); RemoteLogger.submittingReports = false; RemoteLogger.SubmitNextReport(); return; } RemoteLogger.Timers.Once(5f, new Action(RemoteLogger.SubmitNextReport), null); }, null, RequestMethod.POST, item.Headers, 0f); }
private static void EnqueueReport(RemoteLogger.Report report) { Dictionary <string, string> .ValueCollection values = report.extra.Values; if (!values.Contains <string>("Oxide.Core") && !values.Contains <string>("Oxide.Plugins.Compiler")) { return; } string[] exceptionFilter = RemoteLogger.ExceptionFilter; for (int i = 0; i < (int)exceptionFilter.Length; i++) { string str = exceptionFilter[i]; if (values.Contains <string>(str) || values.Contains <string>(str)) { return; } } RemoteLogger.QueuedReports.Add(new RemoteLogger.QueuedReport(report)); if (!RemoteLogger.submittingReports) { RemoteLogger.SubmitNextReport(); } }
private static void EnqueueReport(string level, string[] stackTrace, string culprit, string message, string exception = null) { RemoteLogger.Report report = new RemoteLogger.Report(level, culprit, message, exception); report.DetectModules(stackTrace); RemoteLogger.EnqueueReport(report); }
public static void Debug(string message) { RemoteLogger.EnqueueReport("debug", Assembly.GetCallingAssembly(), RemoteLogger.GetCurrentMethod(), message, null); }
public QueuedReport(RemoteLogger.Report report) { this.Headers = RemoteLogger.BuildHeaders(); this.Body = JsonConvert.SerializeObject(report); }