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