Table of Contents

Class LoggingComponentRenderer

Namespace
Sitecore.AspNetCore.SDK.RenderingEngine.Rendering
Assembly
Sitecore.AspNetCore.SDK.RenderingEngine.dll

An IComponentRenderer that writes to a specified log instead of generating HTML output.

public class LoggingComponentRenderer : IComponentRenderer
Inheritance
LoggingComponentRenderer
Implements
Inherited Members

Remarks

Initializes a new instance of the LoggingComponentRenderer class.

Constructors

LoggingComponentRenderer(ILogger<LoggingComponentRenderer>)

An IComponentRenderer that writes to a specified log instead of generating HTML output.

public LoggingComponentRenderer(ILogger<LoggingComponentRenderer> logger)

Parameters

logger ILogger<LoggingComponentRenderer>

The ILogger to use for logging.

Remarks

Initializes a new instance of the LoggingComponentRenderer class.

Methods

Describe(Predicate<string>)

Creates an instance of a ComponentRendererDescriptor for the LoggingComponentRenderer class.

public static ComponentRendererDescriptor Describe(Predicate<string> match)

Parameters

match Predicate<string>

A predicate to use when attempting to match a layout component.

Returns

ComponentRendererDescriptor

An instance of ComponentRendererDescriptor that describes the LoggingComponentRenderer.

Render(ISitecoreRenderingContext, ViewContext)

Generates the output HTML.

public Task<IHtmlContent> Render(ISitecoreRenderingContext renderingContext, ViewContext viewContext)

Parameters

renderingContext ISitecoreRenderingContext

The current ISitecoreRenderingContext.

viewContext ViewContext

The current ViewContext.

Returns

Task<IHtmlContent>

The HTML content to render.