当前位置: 首页>>代码示例>>C#>>正文


C# ILoggerFactory.?.CreateLogger方法代码示例

本文整理汇总了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");
        }
开发者ID:CactusSoft,项目名称:Cactus.Fileserver,代码行数:7,代码来源:DeleteFileHandler.cs

示例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);
        }
开发者ID:geffzhang,项目名称:Foundatio,代码行数:10,代码来源:ServiceProvider.cs

示例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;
        }
开发者ID:sdougherty,项目名称:Configuration,代码行数:25,代码来源:ConfigServerConfigurationProviderBase.cs

示例4: GetDescriptionAction

 public GetDescriptionAction(ILoggerFactory loggerFactory = null)
 {
     _logger = loggerFactory?.CreateLogger(typeof(GetDescriptionAction).FullName);
 }
开发者ID:lianzhao,项目名称:wiki2dict,代码行数:4,代码来源:GetDescriptionAction.cs

示例5: AddFileHandler

 public AddFileHandler(ILoggerFactory logFactory, ProcessFunc processFunc)
 {
     this.processFunc = processFunc;
     log = logFactory?.CreateLogger(GetType().Name);
     log?.LogDebug(".ctor");
 }
开发者ID:CactusSoft,项目名称:Cactus.Fileserver,代码行数:6,代码来源:AddFileHandler.cs

示例6: ProjectStatesCache

 public ProjectStatesCache(ILoggerFactory loggerFactory)
 {
     _logger = loggerFactory?.CreateLogger<ProjectStatesCache>() ?? new DummyLogger<ProjectStatesCache>();
 }
开发者ID:RLittlesII,项目名称:omnisharp-roslyn,代码行数:4,代码来源:ProjectStatesCache.cs

示例7: Wiki

 public Wiki(HttpClient httpClient, IDictEntryAction furtherAction = null, ILoggerFactory loggerFactory = null)
 {
     _httpClient = httpClient;
     _furtherAction = furtherAction;
     _logger = loggerFactory?.CreateLogger(typeof (Wiki).FullName);
 }
开发者ID:lianzhao,项目名称:wiki2dict,代码行数:6,代码来源:Wiki.cs

示例8: RC1ForwardingActivator

 public RC1ForwardingActivator(IServiceProvider services, ILoggerFactory loggerFactory)
     : base(services)
 {
     _logger = loggerFactory?.CreateLogger(typeof(RC1ForwardingActivator));
 }
开发者ID:yonglehou,项目名称:DataProtection,代码行数:5,代码来源:RC1ForwardingActivator.cs


注:本文中的ILoggerFactory.?.CreateLogger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。