語言

FakeLogRecord 建構函式

定義

初始化 FakeLogRecord 類別的新執行個體。

public:
 FakeLogRecord(Microsoft::Extensions::Logging::LogLevel level, Microsoft::Extensions::Logging::EventId id, System::Object ^ state, Exception ^ exception, System::String ^ message, System::Collections::Generic::IReadOnlyList<System::Object ^> ^ scopes, System::String ^ category, bool enabled, DateTimeOffset timestamp);
public FakeLogRecord(Microsoft.Extensions.Logging.LogLevel level, Microsoft.Extensions.Logging.EventId id, object? state, Exception? exception, string message, System.Collections.Generic.IReadOnlyList<object?> scopes, string? category, bool enabled, DateTimeOffset timestamp);
new Microsoft.Extensions.Logging.Testing.FakeLogRecord : Microsoft.Extensions.Logging.LogLevel * Microsoft.Extensions.Logging.EventId * obj * Exception * string * System.Collections.Generic.IReadOnlyList<obj> * string * bool * DateTimeOffset -> Microsoft.Extensions.Logging.Testing.FakeLogRecord
Public Sub New (level As LogLevel, id As EventId, state As Object, exception As Exception, message As String, scopes As IReadOnlyList(Of Object), category As String, enabled As Boolean, timestamp As DateTimeOffset)

參數

level
LogLevel

產生日誌記錄時所使用的等級。

id
EventId

ID 代表特定的對數陳述。

state
Object

呼叫者在建立日誌記錄時所提供的不透明狀態。

exception
Exception

與日誌記錄相關的可選例外。

message
String

這是格式化的訊息文字,供記錄參考。

scopes
IReadOnlyList<Object>

此日誌記錄中活躍的範圍列表。

category
String

此紀錄的可選類別,對應於 中的 ILogger<TCategoryName>T

enabled
Boolean

當方法被呼叫時 Log<TState>(LogLevel, EventId, TState, Exception, Func<TState,Exception,String>) ,日誌層級是否啟用。

timestamp
DateTimeOffset

日誌記錄建立的時間點。

適用於