Class TextToken
A message template token representing literal text.
public sealed class TextToken : MessageTemplateToken
- Inheritance
-
TextToken
- Inherited Members
Constructors
TextToken(string)
Construct a TextToken.
public TextToken(string text)
Parameters
text
stringThe text of the token.
Exceptions
- ArgumentNullException
When
text
isnull
Properties
Length
The token's length.
public override int Length { get; }
Property Value
Text
The text of the token.
public string Text { get; }
Property Value
Methods
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as a hash function for a particular type.
public override int GetHashCode()
Returns
Render(IReadOnlyDictionary<string, LogEventPropertyValue>, TextWriter, IFormatProvider?)
Render the token to the output.
public override void Render(IReadOnlyDictionary<string, LogEventPropertyValue> properties, TextWriter output, IFormatProvider? formatProvider = null)
Parameters
properties
IReadOnlyDictionary<string, LogEventPropertyValue>Properties that may be represented by the token.
output
TextWriterOutput for the rendered string.
formatProvider
IFormatProviderSupplies culture-specific formatting information, or null.
Exceptions
- ArgumentNullException
When
output
isnull
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.