PostSharpAPI ReferencePost­Sharp.​Patterns.​Diagnostics.​Record­BuildersLog­Record­BuilderWrite­Custom­Parameter
Open sandboxFocus

LogRecordBuilder.WriteCustomParameter Method

WriteCustomParameter<T>(Int32, ArraySegment<Char>, T)

Writes a custom parameter (passed as an ArraySegment<char>) and uses the default formatter.

Declaration
public void WriteCustomParameter<T>(int index, ArraySegment<char> parameterName, T value)
Parameters
Type Name Description
Int32 index

Index of the custom parameter in the formatting string.

ArraySegment<System.Char> parameterName

Name of the custom parameter.

T value

Value of the custom parameter.

Type Parameters
Name Description
T

Type of the custom parameter.

WriteCustomParameter<T>(Int32, ArraySegment<Char>, T, IFormatter<T>)

Writes a custom parameter (passed as an ArraySegment<char>) and uses a given formatter.

Declaration
public abstract void WriteCustomParameter<T>(int index, ArraySegment<char> parameterName, T value, IFormatter<T> formatter)
Parameters
Type Name Description
Int32 index

Index of the custom parameter in the formatting string.

ArraySegment<System.Char> parameterName

Name of the custom parameter.

T value

Value of the custom parameter.

IFormatter<T> formatter

The formatter to be used to format value.

Type Parameters
Name Description
T

Type of the custom parameter.

WriteCustomParameter<T>(Int32, in CharSpan, T, in CustomLogParameterOptions, IFormatter<T>)

Writes a custom parameter (passed as an CharSpan) and uses a given formatter.

Declaration
public virtual void WriteCustomParameter<T>(int index, in CharSpan parameterName, T value, in CustomLogParameterOptions options, IFormatter<T> formatter)
Parameters
Type Name Description
Int32 index

Index of the custom parameter in the formatting string.

CharSpan parameterName

Name of the custom parameter.

T value

Value of the custom parameter.

CustomLogParameterOptions options

Options.

IFormatter<T> formatter

The formatter to be used to format value.

Type Parameters
Name Description
T

Type of the custom parameter.

WriteCustomParameter<T>(Int32, in CharSpan, T, in CustomLogParameterOptions)

Writes a custom parameter (passed as an CharSpan) and uses the default formatter.

Declaration
public void WriteCustomParameter<T>(int index, in CharSpan parameterName, T value, in CustomLogParameterOptions options)
Parameters
Type Name Description
Int32 index

Index of the custom parameter in the formatting string.

CharSpan parameterName

Name of the custom parameter.

T value

Value of the custom parameter.

CustomLogParameterOptions options

Options.

Type Parameters
Name Description
T

Type of the custom parameter.