using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Pcb.Common { public struct HttpRequestLogInfo { public DateTime StartTime { get; set; } public DateTime EndTime { get; set; } public string Url { get; set; } public bool IsAjaxRequest { get; set; } public string TimeCost { get; set; } public void Start() { this.StartTime = DateTime.Now; } public void End() { this.EndTime = DateTime.Now; } public static void Print(HttpRequestLogInfo logInfo) { var timeCost = logInfo.EndTime - logInfo.StartTime; //LogHelper.Info("请求信息:Url->" + logInfo.Url + ", 请求时间->" + timeCost + ", 是否ajax请求->" + logInfo.IsAjaxRequest); } } }