FakeLogRecord 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
初始化 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
表示特定記錄語句的標識碼。
- 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
建立記錄檔記錄的時間。