Show / Hide Table of Contents

Class LoggedActionRenderer<T>

Decorates an IActionRenderer<T> so that all event messages are logged. In other words, this is an IActionRenderer<T> version of LoggedRenderer<T>.

Every single event message causes two log messages: one is logged before rendering, and other one is logged after rendering. If any exception is thrown it is also logged with the log level (regardless of Level configuration).

Inheritance
Object
LoggedRenderer<T>
LoggedActionRenderer<T>
Implements
IActionRenderer<T>
IRenderer<T>
Inherited Members
LoggedRenderer<T>.Renderer
LoggedRenderer<T>.Level
LoggedRenderer<T>.Logger
LoggedRenderer<T>.RenderBlock(Block<T>, Block<T>)
LoggedRenderer<T>.RenderReorg(Block<T>, Block<T>, Block<T>)
LoggedRenderer<T>.RenderReorgEnd(Block<T>, Block<T>, Block<T>)
LoggedRenderer<T>.LogBlockRendering(String, Block<T>, Block<T>, System.Action<Block<T>, Block<T>>)
Namespace: Libplanet.Blockchain.Renderers
Assembly: Libplanet.dll
Syntax
public class LoggedActionRenderer<T> : LoggedRenderer<T>, IActionRenderer<T>, IRenderer<T> where T : IAction, new()
Type Parameters
Name Description
T

An IAction type. It should match to BlockChain<T>'s type parameter.

Examples
IActionRenderer<ExampleAction> actionRenderer = new SomeActionRenderer();
// Wraps the action renderer with LoggedActionRenderer:
actionRenderer = new LoggedActionRenderer<ExampleAction>(
    actionRenderer,
    Log.Logger,
    LogEventLevel.Information,
);

Constructors

| Improve this Doc View Source

LoggedActionRenderer(IActionRenderer<T>, ILogger, LogEventLevel)

Creates a new LoggedActionRenderer<T> instance which decorates the given action renderer.

Declaration
public LoggedActionRenderer(IActionRenderer<T> renderer, ILogger logger, LogEventLevel level = null)
Parameters
Type Name Description
IActionRenderer<T> renderer

The actual action renderer to forward all event messages to and actually render things.

ILogger logger

The logger to write log messages to. Note that all log messages this decorator writes become in the context of the renderer's type (with the context property SourceContext).

LogEventLevel level

The log event level. All log messages become this level.

Properties

| Improve this Doc View Source

ActionRenderer

The inner action renderer to forward all event messages to and actually render things.

Declaration
public IActionRenderer<T> ActionRenderer { get; }
Property Value
Type Description
IActionRenderer<T>

Methods

| Improve this Doc View Source

RenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void RenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

RenderActionError(IAction, IActionContext, Exception)

Declaration
public void RenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception
| Improve this Doc View Source

RenderBlockEnd(Block<T>, Block<T>)

Declaration
public void RenderBlockEnd(Block<T> oldTip, Block<T> newTip)
Parameters
Type Name Description
Block<T> oldTip
Block<T> newTip
| Improve this Doc View Source

UnrenderAction(IAction, IActionContext, IAccountStateDelta)

Declaration
public void UnrenderAction(IAction action, IActionContext context, IAccountStateDelta nextStates)
Parameters
Type Name Description
IAction action
IActionContext context
IAccountStateDelta nextStates
| Improve this Doc View Source

UnrenderActionError(IAction, IActionContext, Exception)

Declaration
public void UnrenderActionError(IAction action, IActionContext context, Exception exception)
Parameters
Type Name Description
IAction action
IActionContext context
Exception exception

Implements

IActionRenderer<T>
IRenderer<T>
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium