Delen via


ConsoleFormatter.Write<TState> Method

Definition

Writes the log message to the specified TextWriter.

public:
generic <typename TState>
 abstract void Write(Microsoft::Extensions::Logging::Abstractions::LogEntry<TState> ^ logEntry, Microsoft::Extensions::Logging::IExternalScopeProvider ^ scopeProvider, System::IO::TextWriter ^ textWriter);
public abstract void Write<TState> (in Microsoft.Extensions.Logging.Abstractions.LogEntry<TState> logEntry, Microsoft.Extensions.Logging.IExternalScopeProvider? scopeProvider, System.IO.TextWriter textWriter);
abstract member Write : LogEntry * Microsoft.Extensions.Logging.IExternalScopeProvider * System.IO.TextWriter -> unit
Public MustOverride Sub Write(Of TState) (logEntry As LogEntry(Of TState), scopeProvider As IExternalScopeProvider, textWriter As TextWriter)

Type Parameters

TState

The type of the object to be written.

Parameters

logEntry
LogEntry<TState>

The log entry.

scopeProvider
IExternalScopeProvider

The provider of scope data.

textWriter
TextWriter

The string writer embedding ansi code for colors.

Remarks

If the formatter wants to write colors to the console, it can do so by embedding ANSI color codes into the string.

Applies to