コード例 #1
0
 public ILogger CreateLogger(string name)
 {
     if (!_loggers.ContainsKey(name))
     {
         lock (_loggers)
         {
             // Have to check again since another thread may have gotten the lock first
             if (!_loggers.ContainsKey(name))
             {
                 _loggers[name] = new Log4NetAdapter(name);
             }
         }
     }
     return(_loggers[name]);
 }
コード例 #2
0
 public ILogger CreateLogger(string name)
 {
     if (!_loggers.ContainsKey(name))
     {
         lock (_loggers)
         {
             // Have to check again since another thread may have gotten the lock first
             if (!_loggers.ContainsKey(name))
             {
                 _loggers[name] = new Log4NetAdapter(name);
             }
         }
     }
     return _loggers[name];
 }