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
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
ISitecoreRenderingContextThe current ISitecoreRenderingContext.
viewContext
ViewContextThe current ViewContext.
Returns
- Task<IHtmlContent>
The HTML content to render.