public static void QueueLogObject(StackifyLib.Models.LogMsg msg) { try { if (_LogClient.CanQueue()) { if (msg.Ex != null) { if (!StackifyError.IgnoreError(msg.Ex) && _LogClient.ErrorShouldBeSent(msg.Ex)) { if (!string.IsNullOrEmpty(msg.Msg)) { msg.Ex.SetAdditionalMessage(msg.Msg); } msg.Msg = msg.Ex.ToString(); } else { msg.Msg += " #errorgoverned"; } if (string.IsNullOrEmpty(msg.Level)) { msg.Level = "ERROR"; } } _LogClient.QueueMessage(msg); } else { StackifyAPILogger.Log("Unable to send log because the queue is full"); } } catch (Exception ex) { StackifyAPILogger.Log(ex.ToString()); } }
public static void QueueLogObject(StackifyLib.Models.LogMsg msg, Exception exceptionObject) { if (exceptionObject != null) { msg.Ex = StackifyError.New(exceptionObject); } QueueLogObject(msg); }
public static void QueueLogObject(StackifyLib.Models.LogMsg msg) { try { if (_LogClient.CanQueue() || SasquatchEnabled()) { if (msg.Ex != null) { if (string.IsNullOrEmpty(msg.Level)) { msg.Level = "ERROR"; } string origMsg = msg.Msg; if (msg.Msg != null && msg.Ex != null) { msg.Msg += "\r\n" + msg.Ex.ToString(); } else if (msg.Msg == null && msg.Ex != null) { msg.Msg = msg.Ex.ToString(); } bool ignore = StackifyError.IgnoreError(msg.Ex); bool shouldSend = _LogClient.ErrorShouldBeSent(msg.Ex); if (!ignore) { if (!string.IsNullOrEmpty(origMsg)) { msg.Ex.SetAdditionalMessage(origMsg); } if (!shouldSend) { msg.Ex = null; msg.Msg += " #errorgoverned"; } } else { msg.Ex = null; } } _LogClient.QueueMessage(msg); } else { StackifyAPILogger.Log("Unable to send log because the queue is full"); } } catch (Exception ex) { StackifyAPILogger.Log(ex.ToString()); } }