Beispiel #1
0
        public ProviderBase(ITelemetronConfigurationBase configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration));
            }

            // configuration is not null
            // delegate can be null
            if (configuration.NullCodepointAction == null)
            {
                this.nullCodepointAction = EmptyCodepointAction.DoNothing;
            }
            else
            {
                this.nullCodepointAction         = EmptyCodepointAction.UseDelegateMethod;
                this.nullCodepointActionDelegate = configuration.NullCodepointAction;
            }

            // copy config local.
            this.emitCodePoint          = configuration.EmitCodePoint;
            this.emitCallerMemberName   = configuration.EmitCallerMemberName;
            this.emitCallerFilePath     = configuration.EmitCallerFilePath;
            this.emitCallerLineNumber   = configuration.EmitCallerLineNumber;
            this.emitAdditionalData     = configuration.EmitAdditionalData;
            this.emitCorrelationContext = configuration.EmitCorrelationContext;
            this.operationConfiguration = configuration.OperationConfiguration
                                          ?? throw new ArgumentNullException($"{nameof(configuration)}.{nameof(configuration.OperationConfiguration)}");

            // dont save configuration reference object
            // setup runtime id
            this.runtimeId = Guid.NewGuid();
        }
Beispiel #2
0
 public TraceTelemetron(ITelemetronConfigurationBase configuration)
     : base(configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException(nameof(configuration));
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="TextWriterTelemetronBase"/> class.
 /// </summary>
 /// <param name="configuration">The configuration for this provider.</param>
 protected TextWriterTelemetronBase(ITelemetronConfigurationBase configuration)
     : base(configuration)
 {
 }
Beispiel #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CorrelatedProviderBase"/> class.
 /// </summary>
 /// <param name="configuration">The inherited configuration from the implementing class to pass to the base class.</param>
 protected CorrelatedProviderBase(ITelemetronConfigurationBase configuration)
     : base(configuration)
 {
     this.correlationContext = new AsyncLocal <ICorrelationContext>();
 }