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

创建日志记录的时间。

适用于