public static IDisposable Push(TelemetryClient telemetryClient, string name, object state) { #if NET46 if (Current == null) { var operation = telemetryClient.StartOperation <LogOperationTelemetry>(name); Current = new LogScope(telemetryClient, operation); } else { var temp = Current; Current = new LogScope(); Current.Parent = temp; } return(new DisposableScope()); #else return(new NullDisposable()); #endif }
public IDisposable BeginScope <TState>(TState state) { return(LogScope.Push(telemetryClient, name, state)); }