Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LogWriterImpl"/> class.
        /// </summary>
        /// <param name="structureHolder">The initial implementation of the logging stack</param>
        /// <param name="instrumentationProvider">The instrumentation provider to use.</param>
        /// <param name="updateCoordinator">The coordinator for logging operations.</param>
        public LogWriterImpl(
            LogWriterStructureHolder structureHolder,
            ILoggingInstrumentationProvider instrumentationProvider,
            ILoggingUpdateCoordinator updateCoordinator)
        {
            Guard.ArgumentNotNull(structureHolder, "structureHolder");
            Guard.ArgumentNotNull(instrumentationProvider, "instrumentationProvider");
            Guard.ArgumentNotNull(updateCoordinator, "updateCoordinator");

            this.instrumentationProvider = instrumentationProvider;
            this.ReplaceStructureHolder(structureHolder);

            this.updateCoordinator = updateCoordinator;
            this.updateCoordinator.RegisterLoggingUpdateHandler(this);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReconfigurableTraceListenerWrapper"/> class with an initial
        /// <see cref="TraceListener"/> to wrap and the <see cref="ILoggingUpdateCoordinator"/> that notifies of
        /// update requests.
        /// </summary>
        /// <param name="wrappedTraceListener">The <see cref="TraceListener"/> to wrap.</param>
        /// <param name="coordinator">The coordinator for updates in the Logging Application Block.</param>
        public ReconfigurableTraceListenerWrapper(
            TraceListener wrappedTraceListener,
            ILoggingUpdateCoordinator coordinator)
        {
            if (wrappedTraceListener == null)
            {
                throw new ArgumentNullException("wrappedTraceListener");
            }
            if (coordinator == null)
            {
                throw new ArgumentNullException("coordinator");
            }

            this.wrappedTraceListener = wrappedTraceListener;
            this.coordinator = coordinator;

            this.coordinator.RegisterLoggingUpdateHandler(this);
        }
Example #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ReconfigurableTraceListenerWrapper"/> class with an initial
        /// <see cref="TraceListener"/> to wrap and the <see cref="ILoggingUpdateCoordinator"/> that notifies of
        /// update requests.
        /// </summary>
        /// <param name="wrappedTraceListener">The <see cref="TraceListener"/> to wrap.</param>
        /// <param name="coordinator">The coordinator for updates in the Logging Application Block.</param>
        public ReconfigurableTraceListenerWrapper(
            TraceListener wrappedTraceListener,
            ILoggingUpdateCoordinator coordinator)
        {
            if (wrappedTraceListener == null)
            {
                throw new ArgumentNullException("wrappedTraceListener");
            }
            if (coordinator == null)
            {
                throw new ArgumentNullException("coordinator");
            }

            this.wrappedTraceListener = wrappedTraceListener;
            this.coordinator          = coordinator;

            this.coordinator.RegisterLoggingUpdateHandler(this);
        }
 public void Setup()
 {
     this.traceListener = null;
     this.eventSource = new MockLoggingUpdateCoordinator();
 }
 public void Setup()
 {
     this.traceListener = new MockTraceListener("mock");
     this.eventSource = null;
 }
 public void Setup()
 {
     coordinator = null;
 }
 public void Setup()
 {
     this.traceListener = null;
     this.eventSource   = new MockLoggingUpdateCoordinator();
 }
 public void Setup()
 {
     this.traceListener = new MockTraceListener("mock");
     this.eventSource   = null;
 }