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


C# ILog.Verbose方法代码示例

本文整理汇总了C#中ILog.Verbose方法的典型用法代码示例。如果您正苦于以下问题:C# ILog.Verbose方法的具体用法?C# ILog.Verbose怎么用?C# ILog.Verbose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ILog的用法示例。


在下文中一共展示了ILog.Verbose方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DefaultTransactionScope

        public DefaultTransactionScope(string name, IsolationLevel isolationLevel, TimeSpan timeout)
        {
            _name = name;

        	_log = Log.For(this);

        	_ignore = Transaction.Current != null;

			if (_ignore)
			{
                if (_log.IsVerboseEnabled)
                {
                    _log.Verbose(string.Format(RecallResources.VerboseTransactionScopeAmbient, name,
                                              Thread.CurrentThread.ManagedThreadId));
                }

			    return;
			}

        	_scope = new TransactionScope(TransactionScopeOption.RequiresNew,
				                             new TransactionOptions
				                             	{
				                             		IsolationLevel = isolationLevel,
				                             		Timeout = timeout
				                             	});

            if (_log.IsVerboseEnabled)
            {
                _log.Verbose(string.Format(RecallResources.VerboseTransactionScopeCreated, name, isolationLevel, timeout,
                                          Thread.CurrentThread.ManagedThreadId));
            }
        }
开发者ID:dario-l,项目名称:shuttle-recall-core,代码行数:32,代码来源:DefaultTransactionScope.cs

示例2: ServiceBusTransactionScope

        public ServiceBusTransactionScope(string name, IsolationLevel isolationLevel, TimeSpan timeout)
        {
            this.name = name;
            log = Log.For(this);

            ignore = Transaction.Current != null;

            if (ignore)
            {
                if (log.IsVerboseEnabled)
                {
                    log.Verbose(string.Format(ESBResources.QueueTransactionScopeAmbient, name,
                                              Thread.CurrentThread.ManagedThreadId));
                }

                return;
            }

            scope = new TransactionScope(TransactionScopeOption.RequiresNew,
                                             new TransactionOptions
                                             	{
                                             		IsolationLevel = isolationLevel,
                                             		Timeout = timeout
                                             	});

            if (log.IsVerboseEnabled)
            {
                log.Verbose(string.Format(ESBResources.QueueTransactionScopeCreated, name, isolationLevel, timeout,
                                          Thread.CurrentThread.ManagedThreadId));
            }
        }
开发者ID:nnyamhon,项目名称:shuttle-esb,代码行数:31,代码来源:ServiceBusTransactionScope.cs

示例3: DatabaseConnection

        public DatabaseConnection(DataSource dataSource, IDbConnection connection, IDbCommandFactory dbCommandFactory, 
            IDatabaseConnectionCache databaseConnectionCache, bool ownedConnection = true, IDbTransaction currentTransaction = null)
        {
            Guard.AgainstNull(dataSource, "dataSource");
            Guard.AgainstNull(connection, "connection");
            Guard.AgainstNull(dbCommandFactory, "dbCommandFactory");
            Guard.AgainstNull(databaseConnectionCache, "databaseConnectionCache");

            _dataSource = dataSource;
            _dbCommandFactory = dbCommandFactory;
            _databaseConnectionCache = databaseConnectionCache;

            Connection = connection;
            _ownedConnection = ownedConnection;
            Transaction = currentTransaction;
            _ownedTransaction = currentTransaction == null;

            _log = Log.For(this);

            _log.Verbose(string.Format(DataResources.DbConnectionCreated, dataSource.Name));

            try
            {
                if (connection.State == ConnectionState.Closed)
                {
                    Connection.Open();
                    _log.Verbose(string.Format(DataResources.DbConnectionOpened, dataSource.Name));
                }
                else
                {
                    _log.Verbose(string.Format(DataResources.DbConnectionAlreadyOpen, dataSource.Name));
                }
            }
            catch (Exception ex)
            {
                _log.Error(string.Format(DataResources.DbConnectionOpenException, dataSource.Name, ex.Message));

                throw;
            }

            databaseConnectionCache.Add(dataSource, this);
        }
开发者ID:ltvan,项目名称:shuttle-core-data,代码行数:42,代码来源:DatabaseConnection.cs

示例4: Initialize

        public static void Initialize(string command, string dir, ILog log)
        {
            if (initialized)
                return;

            log = log ?? Logging.NullLog.Instance;

            initialized = true;

            log.Verbose("Initialization...");

            ConsoleHost host = new ConsoleHost(dir);

            ConsoleSettingsStorageProvider ssp = new ConsoleSettingsStorageProvider();
            ssp.Init(host, string.Empty);
            Collectors.SettingsProvider = ssp;

            Exchanger.ResourceExchanger = new ResourceExchanger();

            MimeTypes.Init();

            // Load Providers
            Collectors.FileNames = new System.Collections.Generic.Dictionary<string, string>(10);
            Collectors.UsersProviderCollector = new ProviderCollector<IUsersStorageProviderV30>();
            Collectors.PagesProviderCollector = new ProviderCollector<IPagesStorageProviderV30>();
            Collectors.FilesProviderCollector = new ProviderCollector<IFilesStorageProviderV30>();
            Collectors.FormatterProviderCollector = new ProviderCollector<IFormatterProviderV30>();
            Collectors.CacheProviderCollector = new ProviderCollector<ICacheProviderV30>();
            Collectors.DisabledUsersProviderCollector = new ProviderCollector<IUsersStorageProviderV30>();
            Collectors.DisabledPagesProviderCollector = new ProviderCollector<IPagesStorageProviderV30>();
            Collectors.DisabledFilesProviderCollector = new ProviderCollector<IFilesStorageProviderV30>();
            Collectors.DisabledFormatterProviderCollector = new ProviderCollector<IFormatterProviderV30>();
            Collectors.DisabledCacheProviderCollector = new ProviderCollector<ICacheProviderV30>();

            IPagesStorageProviderV30 p = new PagesStorageProvider();
            if (!ProviderLoader.IsDisabled(p.GetType().FullName))
            {
                p.Init(host, "");
                Collectors.PagesProviderCollector.AddProvider(p);
                Log.LogEntry("Provider " + p.Information.Name + " loaded (Enabled)", EntryType.General, Log.SystemUsername);
            }
            else
            {
                Collectors.DisabledPagesProviderCollector.AddProvider(p);
                Log.LogEntry("Provider " + p.Information.Name + " loaded (Disabled)", EntryType.General, Log.SystemUsername);
            }

            p = new ScrewTurn.Wiki.Plugins.SqlServer.SqlServerPagesStorageProvider();
            if (!ProviderLoader.IsDisabled(p.GetType().FullName))
            {
                p.Init(host, ConfigurationManager.ConnectionStrings["Default"].ConnectionString);
                Collectors.PagesProviderCollector.AddProvider(p);
                Log.LogEntry("Provider " + p.Information.Name + " loaded (Enabled)", EntryType.General, Log.SystemUsername);
            }
            else
            {
                Collectors.DisabledPagesProviderCollector.AddProvider(p);
                Log.LogEntry("Provider " + p.Information.Name + " loaded (Disabled)", EntryType.General, Log.SystemUsername);
            }

            CacheProvider c = new CacheProvider();
            if (!ProviderLoader.IsDisabled(c.GetType().FullName))
            {
                c.Init(host, "");
                Collectors.CacheProviderCollector.AddProvider(c);
                Log.LogEntry("Provider " + c.Information.Name + " loaded (Enabled)", EntryType.General, Log.SystemUsername);
            }
            else
            {
                Collectors.DisabledCacheProviderCollector.AddProvider(c);
                Log.LogEntry("Provider " + c.Information.Name + " loaded (Disabled)", EntryType.General, Log.SystemUsername);
            }

            log.Verbose("Initialisation OK");

            //CommandBase commandBase;

            //switch (command.ToLowerInvariant())
            //{
            //    case "extract":
            //        commandBase = new ExtractPagesCommand(args[2], args[3])
            //        {
            //            Filter = args.Length > 4 ? args[4] : null
            //        };
            //        break;

            //    case "buildindex":
            //        commandBase = new BuildIndexCommand(args[2], args[3]);
            //        break;

            //    case "addlinkscategory":
            //        commandBase = new AddLinksCategoryCommand(args[2], args[3]);
            //        break;

            //    default:
            //        throw new ArgumentOutOfRangeException(command);
            //}

            //commandBase.Run();
        }
开发者ID:Pathfinder-Fr,项目名称:WikiXmlExport,代码行数:100,代码来源:ScrewTurnContext.cs

示例5: Crawl

        /// <summary>
        /// 	Start crawl process
        /// </summary>
        public virtual void Crawl()
        {
            if (m_OnlyOneCrawlPerInstance)
            {
                throw new InvalidOperationException("Crawler instance cannot be reused");
            }

            m_OnlyOneCrawlPerInstance = true;

            Parameter[] parameters = new Parameter[]
                {
                    new TypedParameter(typeof (Uri), m_BaseUri),
                    new NamedParameter("crawlStart", m_BaseUri),
                    new TypedParameter(typeof (Crawler), this),
                };
            m_CrawlerQueue = m_LifetimeScope.Resolve<ICrawlerQueue>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof (ICrawlerQueue), m_CrawlerQueue)).ToArray();
            m_CrawlerHistory = m_LifetimeScope.Resolve<ICrawlerHistory>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof (ICrawlerHistory), m_CrawlerHistory)).ToArray();
            m_TaskRunner = m_LifetimeScope.Resolve<ITaskRunner>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof (ITaskRunner), m_TaskRunner)).ToArray();
            m_Logger = m_LifetimeScope.Resolve<ILog>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof (ILog), m_Logger)).ToArray();
            m_CrawlerRules = m_LifetimeScope.Resolve<ICrawlerRules>(parameters);
            m_Logger.Verbose("Crawl started @ {0}", m_BaseUri);
            m_WebDownloaderFactory = m_LifetimeScope.Resolve<Func<IWebDownloader>>();
            using (m_CrawlCompleteEvent = new ManualResetEvent(false))
            {
                m_Crawling = true;
                m_Runtime = Stopwatch.StartNew();

                if (m_CrawlerQueue.Count > 0)
                {
                    // Resume enabled
                    ProcessQueue();
                }
                else
                {
                    AddStep(m_BaseUri, 0);
                }

                if (!m_CrawlStopped)
                {
                    m_CrawlCompleteEvent.WaitOne();
                }

                m_Runtime.Stop();
                m_Crawling = false;
            }

            if (m_Cancelled)
            {
                OnCancelled();
            }

            m_Logger.Verbose("Crawl ended @ {0} in {1}", m_BaseUri, m_Runtime.Elapsed);
            OnCrawlFinished();
        }
开发者ID:osamede,项目名称:social_listen,代码行数:61,代码来源:Crawler.cs

示例6: Crawl

        /// <summary>
        /// 	Start crawl process
        /// </summary>
        public virtual void Crawl()
        {
            using (var stream = new StreamReader(AppDomain.CurrentDomain.BaseDirectory + "OriginalWebSite.txt", Encoding.UTF8))
            {
                var jsonStr = stream.ReadToEnd();
                var policy = new CacheItemPolicy();
                policy.Priority = CacheItemPriority.NotRemovable;
                policy.AbsoluteExpiration = DateTimeOffset.Now.AddDays(1);
                cache.Set(AppDomain.CurrentDomain.BaseDirectory + "OriginalWebSite", jsonStr, policy);
                Console.WriteLine("cache --" + AppDomain.CurrentDomain.BaseDirectory + " :" + cache.Get(AppDomain.CurrentDomain.BaseDirectory + "OriginalWebSite"));
            }
            
            if (m_OnlyOneCrawlPerInstance)
            {
                throw new InvalidOperationException("Crawler instance cannot be reused");
            }

            m_OnlyOneCrawlPerInstance = true;

            Parameter[] parameters = new Parameter[]
				{
					new TypedParameter(typeof (Uri), m_BaseUri),
					new NamedParameter("crawlStart", m_BaseUri),
					new TypedParameter(typeof (Crawler), this),
				};
            m_CrawlerQueue = m_LifetimeScope.Resolve<ICrawlerQueue>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof(ICrawlerQueue), m_CrawlerQueue)).ToArray();
            m_CrawlerHistory = m_LifetimeScope.Resolve<ICrawlerHistory>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof(ICrawlerHistory), m_CrawlerHistory)).ToArray();
            m_TaskRunner = m_LifetimeScope.Resolve<ITaskRunner>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof(ITaskRunner), m_TaskRunner)).ToArray();
            m_Logger = m_LifetimeScope.Resolve<ILog>(parameters);
            parameters = parameters.AddToEnd(new TypedParameter(typeof(ILog), m_Logger)).ToArray();
            m_CrawlerRules = m_LifetimeScope.Resolve<ICrawlerRules>(parameters);
            m_Logger.Verbose("Crawl started @ {0}", m_BaseUri);
            m_WebDownloaderFactory = m_LifetimeScope.Resolve<Func<IWebDownloader>>();
            using (m_CrawlCompleteEvent = new ManualResetEvent(false))
            {
                m_Crawling = true;
                m_Runtime = Stopwatch.StartNew();

                if (m_CrawlerQueue.Count > 0)
                {
                    // Resume enabled
                    ProcessQueue();
                }
                else
                {
                    AddStep(m_BaseUri, 0);
                }

                if (!m_CrawlStopped)
                {
                    m_CrawlCompleteEvent.WaitOne();
                }

                m_Runtime.Stop();
                m_Crawling = false;
            }

            if (m_Cancelled)
            {
                OnCancelled();
            }

            m_Logger.Verbose("Crawl ended @ {0} in {1}", m_BaseUri, m_Runtime.Elapsed);
            OnCrawlFinished();
        }
开发者ID:GBmono,项目名称:GBmonoV1.0,代码行数:71,代码来源:Crawler.cs

示例7: Crawl

        /// <summary>
        /// Start crawl process
        /// </summary>
        public virtual void Crawl()
        {
            if (m_Crawling)
            {
                throw new InvalidOperationException("Crawler already running");
            }

            Parameter[] parameters = new Parameter[]
                {
                    new TypedParameter(typeof (Uri), m_BaseUri),
                    new NamedParameter("crawlStart", m_BaseUri),
                    new NamedParameter("resume", false),
                    new NamedParameter("crawler", this),
                };
            m_CrawlerQueue = m_LifetimeScope.Resolve<ICrawlerQueue>(parameters);
            m_CrawlerHistory = m_LifetimeScope.Resolve<ICrawlerHistory>(parameters);
            m_Robot = AdhereToRobotRules ? m_LifetimeScope.Resolve<IRobot>(parameters) : new DummyRobot();
            m_TaskRunner = m_LifetimeScope.Resolve<ITaskRunner>(parameters);
            m_Logger = m_LifetimeScope.Resolve<ILog>(parameters);

            m_Logger.Verbose("Crawl started @ {0}", m_BaseUri);
            using (m_CrawlCompleteEvent = new ManualResetEvent(false))
            {
                m_Crawling = true;
                m_Runtime = Stopwatch.StartNew();
                AddStep(m_BaseUri, 0);
                if (!m_CrawlStopped)
                {
                    m_CrawlCompleteEvent.WaitOne();
                }

                m_Runtime.Stop();
                m_Crawling = false;
            }

            if (m_Cancelled)
            {
                OnCancelled();
            }

            m_Logger.Verbose("Crawl ended @ {0} in {1}", m_BaseUri, m_Runtime.Elapsed);
            OnCrawlFinished();
        }
开发者ID:bormaxi,项目名称:NCrawler,代码行数:46,代码来源:Crawler.cs


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