Method Create
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
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
textWriterTextWriterThe 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
stringBuilderStringBuilderThe 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
loggersILogWriter[]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.