Table of Contents

Method WriteKeyValue

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

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

writer ILogWriter

The log writer to which the key-value pair will be written. Cannot be null.

key object

The key to write. Typically identifies the value being logged. Cannot be null.

value object

The 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.