Exemplo n.º 1
0
        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
        }
Exemplo n.º 2
0
 public IDisposable BeginScope <TState>(TState state)
 {
     return(LogScope.Push(telemetryClient, name, state));
 }