/// <summary> /// Begins a logical operation scope. /// </summary> /// <typeparam name="TState">The type of the state.</typeparam> /// <param name="state">The identifier for the scope.</param> /// <returns> /// An IDisposable that ends the logical operation scope on dispose. /// </returns> public IDisposable BeginScope <TState>(TState state) { if (state == null) { throw new ArgumentNullException(nameof(state)); } return(Log4NetScope.Push(Name, state)); }
public static IDisposable Push(string name, object state) { var temp = Current; Current = new Log4NetScope(name, state); Current.Parent = temp; return(new DisposableScope()); }