Method WriteKeyValue
WriteKeyValue(ILogWriter, object, object?)
Writes a key-value pair to the log in the format "key: value".
public static ILogWriter WriteKeyValue(this ILogWriter writer, object key, object? value)
Parameters
writerILogWriterThe log writer to which the key-value pair will be written. Cannot be null.
keyobjectThe key to write. Typically identifies the value being logged. Cannot be null.
valueobjectThe value associated with the key. If null, the string "null" is written.
Returns
- ILogWriter
The same ILogWriter instance, to support method chaining.
Remarks
This method is an extension method for ILogWriter and enables fluent logging of key-value pairs. The output format is intended for human-readable logs and may not be suitable for structured logging scenarios.