예제 #1
0
 public LogMessage(Logger.Level level, string text, DateTime dateTime, string callingClass, string callingMethod, int lineNumber)
 {
     Level         = level;
     Text          = text;
     DateTime      = dateTime;
     CallingClass  = callingClass;
     CallingMethod = callingMethod;
     LineNumber    = lineNumber;
 }
예제 #2
0
    /*!
     * \brief Debug the concentration of each molecules of the medium
     */
    public void Log(Logger.Level level = Logger.Level.TRACE)
    {
        string content = "";

        foreach (Molecule m in _molecules)
        {
            if (!string.IsNullOrEmpty(content))
            {
                content += ", ";
            }
            content += m.ToString();
        }

        Logger.Log("Medium::debug() #" + _numberId + "[" + content + "]", level);
    }
예제 #3
0
 public static T Find <T>(LinkedList <T> list, Predicate <T> predicate, bool warn = false, string debugMsg = "")
 {
     foreach (T t in list)
     {
         if (predicate(t))
         {
             return(t);
         }
     }
     Logger.Level level = Logger.Level.DEBUG;
     if (warn)
     {
         level = Logger.Level.WARN;
     }
     Logger.Log("LinkedListExtensions::Find couldn't find any fitting element!" + debugMsg, level);
     return(default(T));
 }