/// <summary> /// 生成范围 /// </summary> /// <param name="name"></param> /// <returns></returns> public static MonitorScope CreateScope(string name) { var scope = new MonitorScope { _isStep = LogRecorder.MonitorItem.InMonitor }; if (LogRecorder.MonitorItem.InMonitor) { LogRecorder.BeginStepMonitor(name); } else { LogRecorder.BeginMonitor(name); } return(scope); }
/// <summary> /// 生成范围 /// </summary> /// <param name="name"></param> /// <returns></returns> public static MonitorScope CreateScope(string name) { if (!LogRecorder.LogMonitor) { return(new MonitorScope()); } var scope = new MonitorScope { _isScope = true, _isStep = LogRecorder.MonitorItem.InMonitor }; if (LogRecorder.MonitorItem.InMonitor) { LogRecorder.BeginStepMonitor(name); } else { IocScope.Logger = IocHelper.Create <ILoggerFactory>().CreateLogger(name); LogRecorder.BeginMonitor(name); } return(scope); }