Example #1
0
 /// <summary>
 /// Sets a level, below which messages are filtered
 /// </summary>
 /// <param name="c">the category to filter</param>
 /// <param name="level">the level to display</param>
 public void SetLevel(UserMessage.Category c, int level)
 {
     lock (m_lock_object)
     {
         m_level[c] = level;
     }
 }
Example #2
0
 /// <summary>
 /// Assocated a sink with a given type of message
 /// </summary>
 /// <param name="c">the category of message</param>
 /// <param name="s">the sink for this category of message</param>
 public void SetSink(UserMessage.Category c, Sink s)
 {
     lock (m_lock_object)
     {
         m_sinks[c] = s;
     }
 }
Example #3
0
 /// <summary>
 /// Remove the sink associated with a specific category of message.
 /// </summary>
 /// <param name="c">the category of message</param>
 public void RemoveSink(UserMessage.Category c)
 {
     lock (m_lock_object)
     {
         m_sinks.Remove(c);
     }
 }
Example #4
0
        /// <summary>
        /// Return the sink given the type of message
        /// </summary>
        /// <param name="c">the type of sink</param>
        /// <returns>the sink associated with the message type</returns>
        public Sink GetSink(UserMessage.Category c)
        {
            Sink s = null;

            lock (m_lock_object)
            {
                m_sinks.TryGetValue(c, out s);
            }

            return(s);
        }
Example #5
0
        /// <summary>
        /// Given the category, this method returns the current
        /// level for this type of message
        /// </summary>
        /// <param name="c">the type of message</param>
        /// <returns>the current level</returns>
        public int GetLevel(UserMessage.Category c)
        {
            int ret = 0;

            lock (m_lock_object)
            {
                if (m_level.ContainsKey(c))
                {
                    ret = m_level[c];
                }
            }

            return(ret);
        }
Example #6
0
 /// <summary>
 /// This function returns TRUE if the logger has a message sink for the given
 /// category of message.  Otherwise it returns FALSE.
 /// </summary>
 /// <param name="c">the category of interest</param>
 /// <returns>true if a sink is present, false otherwise</returns>
 public bool HasSink(UserMessage.Category c)
 {
     return(m_sinks.Keys.Contains(c));
 }