ILogger.LogAsync<TState> Method

Definition

Asynchronously logs a message with the specified log level, state, exception, and formatter.

public System.Threading.Tasks.Task LogAsync<TState>(Microsoft.Testing.Platform.Logging.LogLevel logLevel, TState state, Exception? exception, Func<TState,Exception?,string> formatter);
abstract member LogAsync : Microsoft.Testing.Platform.Logging.LogLevel * 'State * Exception * Func<'State, Exception, string> -> System.Threading.Tasks.Task
Public Function LogAsync(Of TState) (logLevel As LogLevel, state As TState, exception As Exception, formatter As Func(Of TState, Exception, String)) As Task

Type Parameters

TState

The type of the state object.

Parameters

logLevel
LogLevel

The log level of the message.

state
TState

The state object.

exception
Exception

The exception associated with the message.

formatter
Func<TState,Exception,String>

The formatter function to format the message.

Returns

A task representing the asynchronous operation.

Applies to