Class LoggingTransformerBase
Base class to expose logging and basic tracing to IMetricsPlanTransformer
Inheritance
Implements
Inherited Members
Namespace: Mangrove.MetricSetSyntaxTree.Logging
Assembly: MetricSetSyntaxTree.dll
Syntax
public abstract class LoggingTransformerBase : IMetricsPlanTransformer
Remarks
Subclasses of this can implement the TransformWithTracing(MetricsPlan, IMetricsPlanValidator) method and get trace messages on entry and exit corresponding interface method for free.
Constructors
View SourceLoggingTransformerBase()
Create this transformer with a logger which does nothing.
Declaration
public LoggingTransformerBase()
LoggingTransformerBase(ILogger)
Use the name of the subclass in logging.
Declaration
public LoggingTransformerBase(ILogger logger)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger |
LoggingTransformerBase(ILogger, String)
Force subclasses to have a constructor which takes a logger and a name.
Declaration
public LoggingTransformerBase(ILogger logger, string transformerName)
Parameters
Type | Name | Description |
---|---|---|
ILogger | logger | If this is null, a default, noop logger will be used. |
String | transformerName | If this is null, the name of the subclass will be used. |
Properties
View SourceLogger
Logger to use when conducting the transformation.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
TransformerName
Name of the underlying transformer (useful in logging).
Declaration
protected string TransformerName { get; }
Property Value
Type | Description |
---|---|
String |
Methods
View SourceTransform(MetricsPlan, IMetricsPlanValidator)
Transform a MetricsPlan into another one, with some basic begin / end logging.
Declaration
public virtual MetricsPlan Transform(MetricsPlan plan, IMetricsPlanValidator validator)
Parameters
Type | Name | Description |
---|---|---|
MetricsPlan | plan | |
IMetricsPlanValidator | validator |
Returns
Type | Description |
---|---|
MetricsPlan |
TransformWithTracing(MetricsPlan, IMetricsPlanValidator)
Overriding this gives you access to Logger during the transformation.
Declaration
public abstract MetricsPlan TransformWithTracing(MetricsPlan metricsPlan, IMetricsPlanValidator validator)
Parameters
Type | Name | Description |
---|---|---|
MetricsPlan | metricsPlan | |
IMetricsPlanValidator | validator |
Returns
Type | Description |
---|---|
MetricsPlan |