• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# ILogProvider类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ILogProvider的典型用法代码示例。如果您正苦于以下问题:C# ILogProvider类的具体用法?C# ILogProvider怎么用?C# ILogProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ILogProvider类属于命名空间,在下文中一共展示了ILogProvider类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: CommonScriptEngine

 protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
 {
     Guard.AgainstNullArgument("logProvider", logProvider);
     ScriptOptions = new ScriptOptions().WithReferences(typeof(Object).Assembly);
     _scriptHostFactory = scriptHostFactory;
     _log = logProvider.ForCurrentType();
 }
开发者ID:scriptcs,项目名称:scriptcs,代码行数:7,代码来源:CommonScriptEngine.cs


示例2: ExecuteReplCommand

        public ExecuteReplCommand(
            string scriptName,
            string[] scriptArgs,
            IFileSystem fileSystem,
            IScriptPackResolver scriptPackResolver,
            IRepl repl,
            ILogProvider logProvider,
            IConsole console,
            IAssemblyResolver assemblyResolver,
            IFileSystemMigrator fileSystemMigrator,
            IScriptLibraryComposer composer)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
            Guard.AgainstNullArgument("repl", repl);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
            Guard.AgainstNullArgument("composer", composer);

            _scriptName = scriptName;
            _scriptArgs = scriptArgs;
            _fileSystem = fileSystem;
            _scriptPackResolver = scriptPackResolver;
            _repl = repl;
            _logger = logProvider.ForCurrentType();
            _console = console;
            _assemblyResolver = assemblyResolver;
            _fileSystemMigrator = fileSystemMigrator;
            _composer = composer;
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:32,代码来源:ExecuteReplCommand.cs


示例3: ApplicationInitialization

 public ApplicationInitialization(
     ILogProvider logProvider,
     IPluginsContainer<IServerInitializer> initializersContainer)
 {
     _deployPackagesLogger = logProvider.GetLogger("DeployPackages");
     _initializersContainer = initializersContainer;
 }
开发者ID:Rhetos,项目名称:Rhetos,代码行数:7,代码来源:ApplicationInitialization.cs


示例4: DslModel

 public DslModel(IDslParser dslParser, ILogProvider logProvider)
 {
     _dslParser = dslParser;
     _performanceLogger = logProvider.GetLogger("Performance");
     _logger = logProvider.GetLogger("DslModel");
     _dslContainer = new DslContainer(logProvider);
 }
开发者ID:koav,项目名称:Rhetos,代码行数:7,代码来源:DslModel.cs


示例5: ScriptExecutor

        public ScriptExecutor(
            IFileSystem fileSystem,
            IFilePreProcessor filePreProcessor,
            IScriptEngine scriptEngine,
            ILogProvider logProvider,
            IScriptLibraryComposer composer)
        {
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
            Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);
            Guard.AgainstNullArgument("filePreProcessor", filePreProcessor);
            Guard.AgainstNullArgument("scriptEngine", scriptEngine);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("composer", composer);

            References = new AssemblyReferences(DefaultReferences);
            Namespaces = new Collection<string>();
            ImportNamespaces(DefaultNamespaces);
            FileSystem = fileSystem;
            FilePreProcessor = filePreProcessor;
            ScriptEngine = scriptEngine;
            _log = logProvider.ForCurrentType();
#pragma warning disable 618
            Logger = new ScriptCsLogger(_log);
#pragma warning restore 618
            ScriptLibraryComposer = composer;
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:27,代码来源:ScriptExecutor.cs


示例6: CompileOnlyOptionFilePreProcessor

 public CompileOnlyOptionFilePreProcessor(
     IFileSystem fileSystem,
     ILogProvider logProvider,
     IEnumerable<ILineProcessor> lineProcessors)
     : base(fileSystem, logProvider, lineProcessors)
 {
 }
开发者ID:vladislav-karamfilov,项目名称:scriptcs-compile-only-option,代码行数:7,代码来源:CompileOnlyOptionFilePreProcessor.cs


示例7: ModuleLoader

        public ModuleLoader(IAssemblyResolver resolver, ILogProvider logProvider, Action<Assembly, AggregateCatalog> addToCatalog, Func<CompositionContainer, IEnumerable<Lazy<IModule, IModuleMetadata>>> getLazyModules, IFileSystem fileSystem, IAssemblyUtility assemblyUtility)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);

            _resolver = resolver;
            _logger = logProvider.ForCurrentType();

            if (addToCatalog == null)
            {
                addToCatalog = (assembly, catalog) =>
                {
                    try
                    {
                        var assemblyCatalog = new AssemblyCatalog(assembly);
                        catalog.Catalogs.Add(assemblyCatalog);
                    }
                    catch (Exception exception)
                    {
                        _logger.DebugFormat("Module Loader exception: {0}", exception.Message);
                    }
                };
            }

            _addToCatalog = addToCatalog;

            if (getLazyModules == null)
            {
                getLazyModules = container => container.GetExports<IModule, IModuleMetadata>();
            }

            _getLazyModules = getLazyModules;
            _fileSystem = fileSystem;
            _assemblyUtility = assemblyUtility;
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:34,代码来源:ModuleLoader.cs


示例8: Proxy

 public Proxy(ILogProvider logProvider, ProxySettings settings)
 {
     LogProvider = logProvider;
     Settings = settings;
     LocalReader = new PacketReader(PacketContext.ClientToServer);
     RemoteReader = new PacketReader(PacketContext.ServerToClient);
 }
开发者ID:ammaraskar,项目名称:SMProxy,代码行数:7,代码来源:Proxy.cs


示例9: DesktopMonitorBaseViewModel

 protected DesktopMonitorBaseViewModel(ILogProvider logProvider)
 {
     if (!IsInDesignMode)
     {
         Log = logProvider.GetLogger(GetType());
     }
 }
开发者ID:MadDonkeySoftware,项目名称:DonkeySuite,代码行数:7,代码来源:DesktopMonitorBaseViewModel.cs


示例10: DslParser

 public DslParser(IDslSource dslSource, IConceptInfo[] conceptInfoPlugins, ILogProvider logProvider)
 {
     _dslSource = dslSource;
     _conceptInfoPlugins = conceptInfoPlugins;
     _performanceLogger = logProvider.GetLogger("Performance");
     _logger = logProvider.GetLogger("DslParser");
 }
开发者ID:koav,项目名称:Rhetos,代码行数:7,代码来源:DslParser.cs


示例11: WatchScriptCommand

        public WatchScriptCommand(
            Config config,
            string[] scriptArgs,
            IConsole console,
            IFileSystem fileSystem,
            ILogProvider logProvider,
            IFileSystemMigrator fileSystemMigrator)
        {
            Guard.AgainstNullArgument("config", config);
            Guard.AgainstNullArgument("scriptArgs", scriptArgs);
            Guard.AgainstNullArgument("console", console);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);

            _config = config;
            _scriptArgs = scriptArgs;
            _console = console;
            _fileSystem = fileSystem;
            _logger = logProvider.ForCurrentType();
            _fileSystemMigrator = fileSystemMigrator;

            _executeScriptCommand = new CrossAppDomainExecuteScriptCommand
            {
                Config = _config,
                ScriptArgs = _scriptArgs,
            };
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:28,代码来源:WatchScriptCommand.cs


示例12: RoslynScriptInMemoryEngine

        public RoslynScriptInMemoryEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
            : base(scriptHostFactory, logProvider)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);

            _log = logProvider.ForCurrentType();
        }
开发者ID:JamesLinus,项目名称:scriptcs,代码行数:7,代码来源:RoslynScriptInMemoryEngine.cs


示例13: StoreController

        //private readonly ILog _log;

        public StoreController(IGenreRepository genres, IAlbumsRepository albums, ILogProvider log)
        {
            _genres = genres;
            _albums = albums;
            _log = log;
            //_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
        }
开发者ID:AndrewLeanSSW,项目名称:SSW.Training.MusicStore.Enterprise,代码行数:9,代码来源:StoreController.cs


示例14: AppDomainAssemblyResolver

        public AppDomainAssemblyResolver(
            ILogProvider logProvider,
            IFileSystem fileSystem,
            IAssemblyResolver resolver,
            IAssemblyUtility assemblyUtility,
            IDictionary<string, AssemblyInfo> assemblyInfoMap = null,
            Func<object, ResolveEventArgs, Assembly> resolveHandler = null)
        {
            Guard.AgainstNullArgument("logProvider", logProvider);
            Guard.AgainstNullArgument("fileSystem", fileSystem);
            Guard.AgainstNullArgument("resolver", resolver);
            Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);

            _assemblyInfoMap = assemblyInfoMap ?? new Dictionary<string, AssemblyInfo>();
            _assemblyUtility = assemblyUtility;
            _logger = logProvider.ForCurrentType();
            _fileSystem = fileSystem;
            _resolver = resolver;

            if (resolveHandler == null)
            {
                resolveHandler = AssemblyResolve;
            }

            AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(resolveHandler);
        }
开发者ID:AsCloud,项目名称:scriptcs,代码行数:26,代码来源:AppDomainAssemblyResolver.cs


示例15: AuthenticationService

        public AuthenticationService(
            ILogProvider logProvider,
            Lazy<IAuthorizationManager> authorizationManager,
            Lazy<IQueryableRepository<IPasswordStrength>> passwordStrengthRules,
            Lazy<IQueryableRepository<IPasswordAttemptsLimit>> passwordAttemptsLimitRepository,
            Lazy<ISqlExecuter> sqlExecuter,
            Lazy<IEnumerable<ISendPasswordResetToken>> sendPasswordResetTokenPlugins)
        {
            _logger = logProvider.GetLogger("AspNetFormsAuth.AuthenticationService");
            _authorizationManager = authorizationManager;
            _sqlExecuter = sqlExecuter;
            _sendPasswordResetTokenPlugin = new Lazy<ISendPasswordResetToken>(() => SinglePlugin(sendPasswordResetTokenPlugins));

            _passwordStrengthRules = passwordStrengthRules;
            _passwordAttemptsLimits = new Lazy<IList<PasswordAttemptsLimit>>(
                () =>
                {
                    var limits = passwordAttemptsLimitRepository.Value.Query()
                        .Select(l => new PasswordAttemptsLimit { MaxInvalidPasswordAttempts = l.MaxInvalidPasswordAttempts, TimeoutInSeconds = l.TimeoutInSeconds })
                        .ToList();
                    foreach (var limit in limits)
                        if (limit.TimeoutInSeconds == null || limit.TimeoutInSeconds <= 0)
                            limit.TimeoutInSeconds = int.MaxValue;
                    return limits;
                });
        }
开发者ID:kmeze,项目名称:Rhetos,代码行数:26,代码来源:AuthenticationService.cs


示例16: MsSqlExecuter

 public MsSqlExecuter(ConnectionString connectionString, ILogProvider logProvider, IUserInfo userInfo)
 {
     _connectionString = connectionString;
     _userInfo = userInfo;
     _logger = logProvider.GetLogger("MsSqlExecuter");
     _performanceLogger = logProvider.GetLogger("Performance");
 }
开发者ID:kmeze,项目名称:Rhetos,代码行数:7,代码来源:MsSqlExecuter.cs


示例17: ConceptApplicationRepository

 public ConceptApplicationRepository(
     ISqlExecuter sqlExecuter,
     ILogProvider logProvider)
 {
     _sqlExecuter = sqlExecuter;
     _logger = logProvider.GetLogger("ConceptApplicationRepository");
 }
开发者ID:koav,项目名称:Rhetos,代码行数:7,代码来源:ConceptApplicationRepository.cs


示例18: HealthNancyModule

        public HealthNancyModule(ILogProvider log, IApplicationHealthChecker checker) : base("/health")
        {
            // Make a module secure by using the below functions
            //this.RequiresHttps();
            //this.RequiresAuthentication();
            //this.RequireClaimOnUrl();  // To authorized make sure "^GET:http(s)?:\/\/.*\/health(\/)?$" is a claim.

            this.log = log;
            this.healthChecker = checker;

            Get["/"] = parameters =>
            {
                using (log.PushContextInfo("healthcheck"))
                {
                    bool isHealthy = false;
                    try
                    {
                        isHealthy = this.healthChecker.IsHealthy();
                    }
                    catch (Exception e)
                    {
                        isHealthy = false;
                        log.WithLogLevel(LogLevel.Error).WriteGeneralException(e);
                    }

                    HttpStatusCode statusCode = isHealthy ? HttpStatusCode.OK : HttpStatusCode.ServiceUnavailable;

                    return Response.AsText(statusCode.ToString())
                                   .WithStatusCode(statusCode)
                                   .WithContentType("text/plain")
                                   .WithHeader("Content-Disposition", "inline")
                                   .WithHeader("Cache-Control", "no-cache");
                }
            };
        }
开发者ID:dugooder,项目名称:a-microservice,代码行数:35,代码来源:HealthNancyModule.cs


示例19: LogActionAttribute

 public LogActionAttribute()
 {
     if (Log == null)
     {
         Log = Container.Get<ILogProvider>();
     }
 }
开发者ID:AndrewLeanSSW,项目名称:SSW.Training.MusicStore.Enterprise,代码行数:7,代码来源:LogActionAttribute.cs


示例20: WatchedDirectory

 public WatchedDirectory(IEntityProvider entityLocator, ILogProvider logProvider, IDirectoryScanner directoryScanner)
 {
     _entityLocator = entityLocator;
     _log = logProvider.GetLogger(GetType());
     _acceptableExtensions = new List<string>();
     _directoryScanner = directoryScanner;
 }
开发者ID:MadDonkeySoftware,项目名称:DonkeySuite,代码行数:7,代码来源:WatchedDirectory.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# ILogService类代码示例发布时间:2022-05-24
下一篇:
C# ILogMessage类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap