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


C# ILogger.CreateChildLogger方法代码示例

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


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

示例1: FileTransaction

		public FileTransaction(string name, DependentTransaction inner, uint stackDepth, ITransactionOptions creationOptions,
								Action onDispose, ILogger logger)
		{
			Contract.Requires(inner != null);
			Contract.Requires(creationOptions != null);
			Contract.Requires(!string.IsNullOrEmpty(name));
			Contract.Requires(logger != null);
			Contract.Ensures(_Name != null);

			_Inner = new Transaction(inner, stackDepth, creationOptions, onDispose, logger.CreateChildLogger("Transaction"));

			_Name = name;
			InnerBegin();
		}
开发者ID:stuartleyland,项目名称:Castle.Transactions,代码行数:14,代码来源:FileTransaction.cs

示例2: LegacyDatabase

 /// <summary>
 /// Initialises a new instance of the <see cref="LegacyDatabase"/> class.
 /// </summary>
 /// <param name="logger">
 /// The logger.
 /// </param>
 /// <param name="configurationHelper">
 /// The configuration Helper.
 /// </param>
 public LegacyDatabase(ILogger logger, IConfigurationHelper configurationHelper)
 {
     this.configurationHelper = configurationHelper;
     this.Log = logger.CreateChildLogger("Helpmebot.Legacy.Database.LegacyDatabase");
 }
开发者ID:tom29739,项目名称:helpmebot,代码行数:14,代码来源:LegacyDatabase.cs

示例3: IrcClient

        /// <summary>
        /// Initialises a new instance of the <see cref="IrcClient"/> class.
        /// </summary>
        /// <param name="client">
        /// The client.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <param name="ircConfiguration">
        /// The configuration Helper.
        /// </param>
        /// <param name="password">
        /// The password.
        /// </param>
        public IrcClient(INetworkClient client, ILogger logger, IIrcConfiguration ircConfiguration, string password)
        {
            this.nickname = ircConfiguration.Nickname;
            this.networkClient = client;
            this.logger = logger;
            this.syncLogger = logger.CreateChildLogger("Sync");
            this.username = ircConfiguration.Username;
            this.realName = ircConfiguration.RealName;
            this.password = password;
            this.networkClient.DataReceived += this.NetworkClientOnDataReceived;
            this.ReceivedMessage += this.OnMessageReceivedEvent;

            this.clientCapabilities = new List<string> { "sasl", "account-notify", "extended-join", "multi-prefix" };

            this.authToServices = ircConfiguration.AuthToServices;

            if (!this.authToServices)
            {
                this.logger.Warn("Services authentication is disabled!");

                this.clientCapabilities.Remove("sasl");
                this.clientCapabilities.Remove("account-notify");
                this.clientCapabilities.Remove("extended-join");
            }

            this.userCache = new Dictionary<string, IrcUser>();
            this.channels = new Dictionary<string, IrcChannel>();

            this.connectionRegistrationSemaphore = new Semaphore(0, 1);
            this.syncLogger.Debug("ctor() acquired connectionRegistration semaphore.");

            this.RegisterConnection(null);
        }
开发者ID:tom29739,项目名称:helpmebot,代码行数:48,代码来源:IrcClient.cs

示例4: WatcherController

        /// <summary>
        /// Initialises a new instance of the <see cref="WatcherController"/> class.
        /// </summary>
        /// <param name="messageService">
        /// The message Service.
        /// </param>
        /// <param name="urlShorteningService">
        /// The url Shortening Service.
        /// </param>
        /// <param name="watchedCategoryRepository">
        /// The watched Category Repository.
        /// </param>
        /// <param name="mediaWikiSiteRepository">
        /// The media Wiki Site Repository.
        /// </param>
        /// <param name="ignoredPagesRepository">
        /// The ignored Pages Repository.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <param name="ircClient">
        /// The IRC Client.
        /// </param>
        /// <param name="legacyDatabase">
        /// The legacy Database.
        /// </param>
        protected WatcherController(
            IMessageService messageService, 
            IUrlShorteningService urlShorteningService, 
            IWatchedCategoryRepository watchedCategoryRepository, 
            IMediaWikiSiteRepository mediaWikiSiteRepository,
            IIgnoredPagesRepository ignoredPagesRepository,
            ILogger logger,
            IIrcClient ircClient,
            ILegacyDatabase legacyDatabase)
        {
            this.messageService = messageService;
            this.urlShorteningService = urlShorteningService;
            this.watchers = new Dictionary<string, CategoryWatcher>();
            this.logger = logger;
            this.ircClient = ircClient;

            foreach (WatchedCategory item in watchedCategoryRepository.Get())
            {
                var categoryWatcher = new CategoryWatcher(
                    item,
                    mediaWikiSiteRepository,
                    ignoredPagesRepository,
                    logger.CreateChildLogger("CategoryWatcher[" + item.Keyword + "]"));
                this.watchers.Add(item.Keyword, categoryWatcher);
                categoryWatcher.CategoryHasItemsEvent += this.CategoryHasItemsEvent;
            }

            this.legacyDatabase = legacyDatabase;
        }
开发者ID:tom29739,项目名称:helpmebot,代码行数:56,代码来源:WatcherController.cs

示例5: NetworkClient

        /// <summary>
        /// Initialises a new instance of the <see cref="NetworkClient"/> class.
        /// </summary>
        /// <param name="hostname">
        /// The hostname.
        /// </param>
        /// <param name="port">
        /// The port.
        /// </param>
        /// <param name="logger">
        /// The logger.
        /// </param>
        /// <param name="startThreads">
        /// The start threads.
        /// </param>
        protected NetworkClient(string hostname, int port, ILogger logger, bool startThreads)
        {
            this.hostname = hostname;
            this.port = port;
            this.logger = logger;
            this.inboundLogger = logger.CreateChildLogger("Inbound");
            this.outboundLogger = logger.CreateChildLogger("Outbound");

            this.logger.InfoFormat("Connecting to socket tcp://{0}:{1}/ ...", hostname, port);

            this.client = new TcpClient(this.hostname, this.port);

            this.Reader = new StreamReader(this.client.GetStream());
            this.Writer = new StreamWriter(this.client.GetStream());
            this.sendQueue = new Queue<string>();

            this.writerThreadResetEvent = new AutoResetEvent(true);

            if (startThreads)
            {
                this.StartThreads();
            }
        }
开发者ID:tom29739,项目名称:helpmebot,代码行数:38,代码来源:NetworkClient.cs


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