Table of Contents

AddXunitTestLogging Method

Definition

Namespace
Codebelt.Extensions.Xunit.Hosting
Assemblies
Codebelt.Extensions.Xunit.Hosting.dll
Source
src/Codebelt.Extensions.Xunit.Hosting/ServiceCollectionExtensions.cs

AddXunitTestLogging(IServiceCollection, LogLevel)

Adds a unit test optimized implementation of logging to the services collection.

public static IServiceCollection AddXunitTestLogging(this IServiceCollection services, LogLevel minimumLevel = LogLevel.Trace)

Parameters

services IServiceCollection

The IServiceCollection to extend.

minimumLevel LogLevel

The LogLevel that specifies the minimum level to include for the logging.

Returns

IServiceCollection

A reference to services so that additional configuration calls can be chained.

Exceptions

ArgumentNullException

services cannot be null.

AddXunitTestLogging(IServiceCollection, ITestOutputHelper, LogLevel)

Adds a unit test optimized implementation of output logging to the services collection.

public static IServiceCollection AddXunitTestLogging(this IServiceCollection services, ITestOutputHelper output, LogLevel minimumLevel = LogLevel.Trace)

Parameters

services IServiceCollection

The IServiceCollection to extend.

output ITestOutputHelper

The Xunit.ITestOutputHelper that provides the output for the logging.

minimumLevel LogLevel

The LogLevel that specifies the minimum level to include for the logging.

Returns

IServiceCollection

A reference to services so that additional configuration calls can be chained.

Exceptions

ArgumentNullException

services cannot be null -or- output cannot be null.