다음을 통해 공유


FakeLogger Constructors

Definition

Overloads

FakeLogger(FakeLogCollector, String)

Initializes a new instance of the FakeLogger class.

FakeLogger(Action<String>, String)

Initializes a new instance of the FakeLogger class that copies all log records to the given output sink.

FakeLogger(FakeLogCollector, String)

Source:
FakeLogger.cs

Initializes a new instance of the FakeLogger class.

public FakeLogger (Microsoft.Extensions.Logging.Testing.FakeLogCollector? collector = default, string? category = default);
new Microsoft.Extensions.Logging.Testing.FakeLogger : Microsoft.Extensions.Logging.Testing.FakeLogCollector * string -> Microsoft.Extensions.Logging.Testing.FakeLogger
Public Sub New (Optional collector As FakeLogCollector = Nothing, Optional category As String = Nothing)

Parameters

collector
FakeLogCollector

Where to push all log state. If this is null then a fresh collector is allocated automatically.

category
String

The logger's category, which indicates the origin of the logger and is captured in each record.

Applies to

FakeLogger(Action<String>, String)

Source:
FakeLogger.cs

Initializes a new instance of the FakeLogger class that copies all log records to the given output sink.

public FakeLogger (Action<string> outputSink, string? category = default);
new Microsoft.Extensions.Logging.Testing.FakeLogger : Action<string> * string -> Microsoft.Extensions.Logging.Testing.FakeLogger
Public Sub New (outputSink As Action(Of String), Optional category As String = Nothing)

Parameters

outputSink
Action<String>

Where to emit individual log records.

category
String

The logger's category, which indicates the origin of the logger and is captured in each record.

Applies to