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


C# ILogProvider类代码示例

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


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


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