Exemplo n.º 1
0
        public void AddMessage(string message)
        {
            if (m_parent != null)
            {
                m_parent.AddMessage(message);
            }
            else
            {
                lock (m_lock)
                {
                    Logging.Log.WriteMessage(message, Duplicati.Library.Logging.LogMessageType.Information);
                    m_messages.Add(message);

                    if (MessageSink != null)
                    {
                        MessageSink.MessageEvent(message);
                    }

                    if (m_db != null && !m_db.IsDisposed)
                    {
                        LogDbMessage("Message", message, null);
                    }
                }
            }
        }
Exemplo n.º 2
0
        public void AddVerboseMessage(string message, params object[] args)
        {
            if (m_parent != null)
            {
                if ((args != null) && (args.Length > 0))
                {
                    m_parent.AddVerboseMessage(message, args);
                }
                else
                {
                    m_parent.AddMessage(message);
                }
            }
            else
            {
                lock (Logging.Log.Lock)
                {
                    if (m_is_reporting)
                    {
                        return;
                    }

                    try
                    {
                        m_is_reporting = true;
                        Logging.Log.WriteMessage((((args != null) && (args.Length > 0)) ? string.Format(message, args) : message), Duplicati.Library.Logging.LogMessageType.Profiling, null);

                        if (MessageSink != null)
                        {
                            if ((args != null) && (args.Length > 0))
                            {
                                MessageSink.VerboseEvent(message, args);
                            }
                            else
                            {
                                MessageSink.MessageEvent(message);
                            }
                        }
                    }
                    finally
                    {
                        m_is_reporting = false;
                    }
                }
            }
        }
Exemplo n.º 3
0
        public void AddMessage(string message)
        {
            if (m_parent != null)
            {
                m_parent.AddMessage(message);
            }
            else
            {
                lock (Logging.Log.Lock)
                {
                    if (m_is_reporting)
                    {
                        return;
                    }

                    try
                    {
                        m_is_reporting = true;
                        Logging.Log.WriteMessage(message, Duplicati.Library.Logging.LogMessageType.Information, null);

                        m_messages.Add(message);

                        if (MessageSink != null)
                        {
                            MessageSink.MessageEvent(message);
                        }

                        lock (m_lock)
                            if (m_db != null && !m_db.IsDisposed)
                            {
                                LogDbMessage("Message", message, null);
                            }
                    }
                    finally
                    {
                        m_is_reporting = false;
                    }
                }
            }
        }