共用方式為


NullLogger.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>

函式,用來建立 stateexceptionString 訊息。

實作

適用於