FakeLogger.Log<TState> 方法

定義

建立新的日誌記錄。

public:
generic <typename TState>
 virtual void Log(Microsoft::Extensions::Logging::LogLevel logLevel, Microsoft::Extensions::Logging::EventId eventId, TState state, Exception ^ exception, Func<TState, Exception ^, System::String ^> ^ formatter);
public void Log<TState>(Microsoft.Extensions.Logging.LogLevel logLevel, Microsoft.Extensions.Logging.EventId eventId, TState state, Exception? exception, Func<TState,Exception?,string> formatter);
abstract member Log : Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * 'State * Exception * Func<'State, Exception, string> -> unit
override this.Log : Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * 'State * Exception * Func<'State, Exception, string> -> unit
Public Sub Log(Of TState) (logLevel As LogLevel, eventId As EventId, state As TState, exception As Exception, formatter As Func(Of TState, Exception, String))

類型參數

TState

要寫入的物件類型。

參數

logLevel
LogLevel

參賽記錄會在這個層級。

eventId
EventId

活動的身份證。

state
TState

即將寫下的日記。 也可以是物體。

exception
Exception

例外與本條目有關。

formatter
Func<TState,Exception,String>

函式用來建立狀態與例外的字串訊息。

實作

適用於