Struct ErrorLogHandler

Interpolated-string handler for Error(string, ref ErrorLogHandler).

Namespace: MOSAIC.Diagnostics
Assembly: MOSAIC.dll
Syntax
public ref struct ErrorLogHandler
Remarks

Same zero-cost-when-disabled mechanism as DebugLogHandler.

Constructors

ErrorLogHandler(int, int, out bool)

Called by the compiler. Sets shouldAppend from the level gate.

Declaration
public ErrorLogHandler(int literalLength, int formattedCount, out bool shouldAppend)
Parameters
Type Name Description
int literalLength

Total length of the literal parts, supplied by the compiler.

int formattedCount

Number of interpolation holes, supplied by the compiler.

bool shouldAppend

False when Error is switched off.

Fields

_enabled

Declaration
private readonly bool _enabled
Field Value
Type Description
bool

_inner

Declaration
private DefaultInterpolatedStringHandler _inner
Field Value
Type Description
DefaultInterpolatedStringHandler

Properties

Enabled

Declaration
internal bool Enabled { get; }
Property Value
Type Description
bool

Methods

AppendFormatted(ReadOnlySpan<char>)

Appends a span hole without an intermediate string.

Declaration
public void AppendFormatted(ReadOnlySpan<char> value)
Parameters
Type Name Description
ReadOnlySpan<char> value

AppendFormatted(string?)

Appends a string hole without boxing it through the generic overload.

Declaration
public void AppendFormatted(string? value)
Parameters
Type Name Description
string value

AppendFormatted<T>(T)

Appends an interpolation hole.

Declaration
public void AppendFormatted<T>(T value)
Parameters
Type Name Description
T value
Type Parameters
Name Description
T

AppendFormatted<T>(T, int)

Appends an interpolation hole with an alignment.

Declaration
public void AppendFormatted<T>(T value, int alignment)
Parameters
Type Name Description
T value
int alignment
Type Parameters
Name Description
T

AppendFormatted<T>(T, int, string?)

Appends an interpolation hole with an alignment and a format string.

Declaration
public void AppendFormatted<T>(T value, int alignment, string? format)
Parameters
Type Name Description
T value
int alignment
string format
Type Parameters
Name Description
T

AppendFormatted<T>(T, string?)

Appends an interpolation hole with a format string.

Declaration
public void AppendFormatted<T>(T value, string? format)
Parameters
Type Name Description
T value
string format
Type Parameters
Name Description
T

AppendLiteral(string)

Appends a literal fragment of the interpolated string.

Declaration
public void AppendLiteral(string value)
Parameters
Type Name Description
string value

ToStringAndClear()

Declaration
internal string ToStringAndClear()
Returns
Type Description
string

Search documentation

Start typing to search the documentation.