Share via


MetadataServicesFactory.CreateTraceSourceAsync<T> Method

Definition

Creates an instance of TraceSource for a given service moniker and contract type.

public static System.Threading.Tasks.Task<System.Diagnostics.TraceSource> CreateTraceSourceAsync<T> (Microsoft.ServiceHub.Framework.IServiceBroker serviceBroker, Microsoft.ServiceHub.Framework.ServiceMoniker? serviceMoniker, Microsoft.VisualStudio.RpcContracts.Logging.LoggerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateTraceSourceAsync : Microsoft.ServiceHub.Framework.IServiceBroker * Microsoft.ServiceHub.Framework.ServiceMoniker * Microsoft.VisualStudio.RpcContracts.Logging.LoggerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Diagnostics.TraceSource>
Public Shared Function CreateTraceSourceAsync(Of T) (serviceBroker As IServiceBroker, serviceMoniker As ServiceMoniker, Optional options As LoggerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TraceSource)

Type Parameters

T

Parameters

serviceBroker
IServiceBroker

Service broker instance to utilize.

serviceMoniker
ServiceMoniker

Service moniker this trace source is intended for.

options
LoggerOptions

Optional trace source options.

cancellationToken
CancellationToken

Cancellation token to monitor.

Returns

an instance of TraceSource instance that can be passed to factory methods.

Applies to