Пример #1
0
 /// <summary>
 /// The function called when a message is logged
 /// </summary>
 /// <param name="entry">The log entry</param>
 public void WriteMessage(LogEntry entry)
 {
     if (m_log != null && (m_filter == null || m_filter.Accepts(entry)))
     {
         m_log.WriteMessage(entry);
     }
 }
Пример #2
0
        public void WriteMessage(Duplicati.Library.Logging.LogEntry entry)
        {
            if (entry.Level < m_logLevel)
            {
                return;
            }

            if (m_serverfile != null && entry.Level >= m_serverloglevel)
            {
                try
                {
                    m_serverfile.WriteMessage(entry);
                }
                catch
                {
                }
            }

            lock (m_lock)
            {
                if (m_anytimeouts)
                {
                    var q = GetActiveTimeouts();

                    if (q.Length == 0)
                    {
                        UpdateLogLevel();
                        m_anytimeouts = false;
                        if (m_buffer == null || m_buffer.Size != INACTIVE_SIZE)
                        {
                            m_buffer = new RingBuffer <LogEntry>(INACTIVE_SIZE, m_buffer);
                        }
                    }
                }

                if (m_buffer != null)
                {
                    m_buffer.Enqueue(new LogEntry(entry));
                }
            }
        }