本文整理汇总了C#中ILoggerFactory.?.CreateLogger方法的典型用法代码示例。如果您正苦于以下问题:C# ILoggerFactory.?.CreateLogger方法的具体用法?C# ILoggerFactory.?.CreateLogger怎么用?C# ILoggerFactory.?.CreateLogger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILoggerFactory
的用法示例。
在下文中一共展示了ILoggerFactory.?.CreateLogger方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteFileHandler
public DeleteFileHandler(ILoggerFactory logFactory, IFileStorageService storageService)
{
log = logFactory?.CreateLogger(GetType().Name);
StorageService = storageService;
log?.LogDebug(".ctor");
}
示例2: FindAndGetServiceProvider
public static IServiceProvider FindAndGetServiceProvider(string relativeTypeName, ILoggerFactory loggerFactory = null) {
if (String.IsNullOrEmpty(relativeTypeName))
return null;
var relativeType = TypeHelper.ResolveType(relativeTypeName, typeof(IServiceProvider), loggerFactory?.CreateLogger("Foundatio.ServiceProviders.ServiceProvider"));
if (relativeType == null)
return null;
return FindAndGetServiceProvider(relativeType, loggerFactory);
}
示例3: ConfigServerConfigurationProviderBase
/// <summary>
/// Initializes a new instance of <see cref="ConfigServerConfigurationProvider"/>.
/// </summary>
/// <param name="settings">the configuration settings the provider uses when
/// accessing the server.</param>
/// <param name="httpClient">a HttpClient the provider uses to make requests of
/// the server.</param>
/// <param name="logFactory">optional logging factory</param>
/// </summary>
internal protected ConfigServerConfigurationProviderBase(ConfigServerClientSettingsBase settings, HttpClient httpClient, ILoggerFactory logFactory = null)
{
if (settings == null)
{
throw new ArgumentNullException(nameof(settings));
}
if (httpClient == null)
{
throw new ArgumentNullException(nameof(httpClient));
}
_logger = logFactory?.CreateLogger<ConfigServerConfigurationProviderBase>();
_settings = settings;
_client = httpClient;
}
示例4: GetDescriptionAction
public GetDescriptionAction(ILoggerFactory loggerFactory = null)
{
_logger = loggerFactory?.CreateLogger(typeof(GetDescriptionAction).FullName);
}
示例5: AddFileHandler
public AddFileHandler(ILoggerFactory logFactory, ProcessFunc processFunc)
{
this.processFunc = processFunc;
log = logFactory?.CreateLogger(GetType().Name);
log?.LogDebug(".ctor");
}
示例6: ProjectStatesCache
public ProjectStatesCache(ILoggerFactory loggerFactory)
{
_logger = loggerFactory?.CreateLogger<ProjectStatesCache>() ?? new DummyLogger<ProjectStatesCache>();
}
示例7: Wiki
public Wiki(HttpClient httpClient, IDictEntryAction furtherAction = null, ILoggerFactory loggerFactory = null)
{
_httpClient = httpClient;
_furtherAction = furtherAction;
_logger = loggerFactory?.CreateLogger(typeof (Wiki).FullName);
}
示例8: RC1ForwardingActivator
public RC1ForwardingActivator(IServiceProvider services, ILoggerFactory loggerFactory)
: base(services)
{
_logger = loggerFactory?.CreateLogger(typeof(RC1ForwardingActivator));
}