Exemple #1
0
 public Configuration(LevelOfDetalization level, string location)
 {
     Level = level;
     if (IsEligible(location))
     {
         Location = location;
     }
     else
     {
         Location = Directory.GetCurrentDirectory() + "\\Errors.txt";
         MyLogger logger = new MyLogger(this);
         logger.Log(new ArgumentException($"Specified location is incorrect! Default location will be used: {Location}"));
     }
 }
 public void WriteMessage(object message, LevelOfDetalization levelOfDetalization = LevelOfDetalization.Error)
 {
     try
     {
         Src.Print(string.Format("{0} | {1} | {2} - {3} \n", levelOfDetalization, DateTime.Now, message, className));
     }
     catch (IOException)
     {
         throw;
     }
     catch (Exception)
     {
         throw;
     }
 }