FakeLoggerServiceCollectionExtensions.AddFakeLogging 方法

定义

重载

AddFakeLogging(IServiceCollection)

使用默认选项配置虚假日志记录。

AddFakeLogging(IServiceCollection, IConfigurationSection)

配置虚假日志记录。

AddFakeLogging(IServiceCollection, Action<FakeLogCollectorOptions>)

配置虚假日志记录。

AddFakeLogging(IServiceCollection)

Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs

使用默认选项配置虚假日志记录。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddFakeLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddFakeLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddFakeLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddFakeLogging (services As IServiceCollection) As IServiceCollection

参数

services
IServiceCollection

服务集合。

返回

services 的值。

适用于

AddFakeLogging(IServiceCollection, IConfigurationSection)

Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs

配置虚假日志记录。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddFakeLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Microsoft::Extensions::Configuration::IConfigurationSection ^ section);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddFakeLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Microsoft.Extensions.Configuration.IConfigurationSection section);
static member AddFakeLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Microsoft.Extensions.Configuration.IConfigurationSection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddFakeLogging (services As IServiceCollection, section As IConfigurationSection) As IServiceCollection

参数

services
IServiceCollection

服务集合。

section
IConfigurationSection

包含 FakeLogCollectorOptions的配置节。

返回

services 的值。

适用于

AddFakeLogging(IServiceCollection, Action<FakeLogCollectorOptions>)

Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs
Source:
FakeLoggerServiceCollectionExtensions.cs

配置虚假日志记录。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::DependencyInjection::IServiceCollection ^ AddFakeLogging(Microsoft::Extensions::DependencyInjection::IServiceCollection ^ services, Action<Microsoft::Extensions::Logging::Testing::FakeLogCollectorOptions ^> ^ configure);
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddFakeLogging (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Extensions.Logging.Testing.FakeLogCollectorOptions> configure);
static member AddFakeLogging : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Extensions.Logging.Testing.FakeLogCollectorOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddFakeLogging (services As IServiceCollection, configure As Action(Of FakeLogCollectorOptions)) As IServiceCollection

参数

services
IServiceCollection

服务集合。

configure
Action<FakeLogCollectorOptions>

日志记录配置选项。

返回

services 的值。

适用于