コード例 #1
0
ファイル: ProviderBase.cs プロジェクト: ZakSir/Common-1
        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();
        }
コード例 #2
0
ファイル: TraceTelemetron.cs プロジェクト: pink-hair/Common
 public TraceTelemetron(ITelemetronConfigurationBase configuration)
     : base(configuration)
 {
     if (configuration == null)
     {
         throw new ArgumentNullException(nameof(configuration));
     }
 }
コード例 #3
0
 /// <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)
 {
 }
コード例 #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>();
 }