Пример #1
0
        /// <summary>
        /// Gets the log from the specific repository.
        /// </summary>
        /// <param name="repositoryName">Name of the repository.</param>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public override ILog GetLog(string repositoryName, string name)
        {
            ILoggerRepository repository = EnsureRepository(repositoryName);

            var logKey = repository.Name + "-" + name;

            if (repository == null)
            {
                return(GetLog(logKey));
            }

            ILog log;

            while (true)
            {
                if (m_LoggersDict.TryGetValue(logKey, out log))
                {
                    return(log);
                }

                log = new Log4NetLog(LogManager.GetLogger(repositoryName, name));

                if (m_LoggersDict.TryAdd(logKey, log))
                {
                    return(log);
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the log from the specific repository.
        /// </summary>
        /// <param name="repositoryName">Name of the repository.</param>
        /// <param name="name">The name.</param>
        /// <returns></returns>
        public override ILog GetLog(string repositoryName, string name)
        {
            ILoggerRepository repository = EnsureRepository(repositoryName);

            if (repository == null)
                return null;

            var logKey = repositoryName + "-" + name;

            ILog log;

            while (true)
            {
                if (m_LoggersDict.TryGetValue(logKey, out log))
                    return log;

                log = new Log4NetLog(LogManager.GetLogger(repositoryName, name));

                if (m_LoggersDict.TryAdd(logKey, log))
                    return log;
            }
        }