Пример #1
0
        public void Log(Level level, string message, Exception exception = null)
        {
            LoggerFormat.Write(String.Format("[{0:G}] [{1}]: {2}", DateTime.Now,
                                             LoggerFormat.Bold + "" + level.LoggerFormat + level.Name + LoggerFormat.Reset,
                                             message + LoggerFormat.Reset) + "\n");

            if (exception != null)
            {
                Log(Level.Error, LoggerFormat.Red + exception.Message + "\n" + exception.StackTrace);
            }
        }
Пример #2
0
 public Level(int rank, string name, LoggerFormat loggerFormat)
 {
     Rank         = rank;
     Name         = name;
     LoggerFormat = loggerFormat;
 }