FakeLogRecord Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the FakeLogRecord class.
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)
Parameters
- level
- LogLevel
The level used when producing the log record.
- id
- EventId
The ID representing the specific log statement.
- state
- Object
The opaque state supplied by the caller when creating the log record.
- exception
- Exception
An optional exception associated with the log record.
- message
- String
The formatted message text for the record.
- scopes
- IReadOnlyList<Object>
List of active scopes active for this log record.
- category
- String
The optional category for this record, which corresponds to the T in ILogger<TCategoryName>.
- enabled
- Boolean
Whether the log level was enabled or not when the Log<TState>(LogLevel, EventId, TState, Exception, Func<TState,Exception,String>) method was called.
- timestamp
- DateTimeOffset
The time at which the log record was created.
Applies to
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應