public static void BaseExceptionLog(BaseException ex, string typeName) { if (!Config.IsDebug) { return; } using (var traceItem = new TraceItem(_logEndAction, typeName)) { traceItem.Log(ex.GetType().Name); traceItem.Log("Message:{0}", ex.Message); traceItem.Log("StackTrace:{0}", ex.StackTrace); if (ex.InnerException != null) { traceItem.Log("InnerException:{0}", ex.InnerException.Message); traceItem.Log("InnerException.StackTrace:{0}", ex.InnerException.StackTrace); } if (OnBaseExceptionFunc != null) { try { OnBaseExceptionFunc(ex); } catch { } } } }
public static void SendApiLog(string url, string returnText) { if (!Config.IsDebug) { return; } using (var traceItem = new TraceItem(_logEndAction, "接口调用")) { traceItem.Log($"URL:{url}"); traceItem.Log($"Result:\r\n{returnText}"); } }
public static void SendApiPostDataLog(string url, string data) { if (!Config.IsDebug) { return; } using (var traceItem = new TraceItem(_logEndAction, "接口调用")) { traceItem.Log($"URL:{url}"); traceItem.Log($"Post Data:\r\n{data}"); } }