/// <inheritdoc/>
        protected override void OnRequestSuccess(RequestDiagnosticData data)
        {
            if (data is null)
            {
                return;
            }

            if (_operationBuilders.TryGetValue(data.Operation, out var builder))
            {
                builder.Outdent();
                builder.AppendLine(TracerMessages.ExitBrace);
                builder.AppendFormattedLine(TracerMessages.ResolveRequestSucceeded, data.RequestContext.Instance);
            }
        }
        /// <inheritdoc/>
        protected override void OnRequestStart(RequestDiagnosticData data)
        {
            if (data is null)
            {
                return;
            }

            if (_operationBuilders.TryGetValue(data.Operation, out var builder))
            {
                builder.AppendFormattedLine(TracerMessages.ResolveRequestStarting);
                builder.AppendLine(TracerMessages.EntryBrace);
                builder.Indent();
                builder.AppendFormattedLine(TracerMessages.ServiceDisplay, data.RequestContext.Service);
                builder.AppendFormattedLine(TracerMessages.ComponentDisplay, data.RequestContext.Registration.Activator.DisplayName());

                if (data.RequestContext.DecoratorTarget is object)
                {
                    builder.AppendFormattedLine(TracerMessages.TargetDisplay, data.RequestContext.DecoratorTarget.Activator.DisplayName());
                }

                builder.AppendLine();
                builder.AppendLine(TracerMessages.Pipeline);
            }
        }
Exemple #3
0
 /// <summary>
 /// Handles the event raised when a resolve request completes successfully.
 /// </summary>
 /// <param name="data">
 /// Diagnostic data associated with the event.
 /// </param>
 /// <remarks>
 /// <para>
 /// Derived classes can override this method and perform actions based
 /// on the event. By default, the base class does nothing.
 /// </para>
 /// </remarks>
 protected virtual void OnRequestSuccess(RequestDiagnosticData data)
 {
 }
Exemple #4
0
 /// <summary>
 /// Handles the event raised when a resolve request starts.
 /// </summary>
 /// <param name="data">
 /// Diagnostic data associated with the event.
 /// </param>
 /// <remarks>
 /// <para>
 /// Derived classes can override this method and perform actions based
 /// on the event. By default, the base class does nothing.
 /// </para>
 /// </remarks>
 protected virtual void OnRequestStart(RequestDiagnosticData data)
 {
 }