Table of Contents

Method Create

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

Create(Action<string>)

Creates an instance of an ILogWriter that writes log messages using the specified action.

public static ILogWriter Create(Action<string> logAction)

Parameters

logAction Action<string>

The action to invoke for each log message. Cannot be null.

Returns

ILogWriter

An ILogWriter that uses the provided action to handle log messages.

Create(TextWriter)

Creates a new instance of an ILogWriter that writes log messages to the specified TextWriter.

public static ILogWriter Create(TextWriter textWriter)

Parameters

textWriter TextWriter

The TextWriter to which log messages will be written. Cannot be null.

Returns

ILogWriter

An ILogWriter instance configured to write log messages to the specified TextWriter.

Create(StringBuilder)

Creates a new instance of an ILogWriter that writes log messages to the specified StringBuilder.

public static ILogWriter Create(StringBuilder stringBuilder)

Parameters

stringBuilder StringBuilder

The StringBuilder to which log messages will be written. Cannot be null.

Returns

ILogWriter

An ILogWriter instance configured to write to the specified StringBuilder.

Create(params ILogWriter[])

Creates a new instance of a log writer that writes log messages to multiple loggers.

public static ILogWriter Create(params ILogWriter[] loggers)

Parameters

loggers ILogWriter[]

An array of log writers to which log messages will be forwarded. Cannot be null.

Returns

ILogWriter

An ILogWriter instance that writes log messages to all specified loggers.

Remarks

The returned log writer forwards each log message to all provided loggers in the order they are specified.