Esempio n. 1
0
 internal void EndStageAndTransitionToStage(LogStage stage)
 {
     this.EndStage();
     if (stage == LogStage.SendResponse)
     {
         this.StartStage(stage, this.creationTime);
         return;
     }
     this.StartStage(stage);
 }
Esempio n. 2
0
 /// <summary>
 /// Writes the logs to the FilePath.
 /// </summary>
 /// <param name="e"></param>
 /// <param name="aiStage"></param>
 private void WriteLog(Exception e, LogStage aiStage)
 {
     if (aiStage >= LocalLogStage)
     {
         if (e.InnerException != null && e.StackTrace != null)
         {
             File.AppendAllText(LogPath, NowAsString + " ( " + aiStage.ToString() + " ) - Message: " + e.Message + " (Inner Exception: " + e.InnerException + " )\r\nStacktrace: " + e.StackTrace + "\r\n");
         }
         else if (e.InnerException != null)
         {
             File.AppendAllText(LogPath, NowAsString + " ( " + aiStage.ToString() + " ) - Message: " + e.Message + " (Inner Exception: " + e.InnerException + " )\r\n");
         }
         else if (e.StackTrace != null)
         {
             File.AppendAllText(LogPath, NowAsString + " ( " + aiStage.ToString() + " ) - Message: " + e.Message + "\r\nStacktrace: " + e.StackTrace + "\r\n");
         }
         else
         {
             File.AppendAllText(LogPath, NowAsString + " ( " + aiStage.ToString() + " ) - Message: " + e.Message + "\r\n");
         }
     }
 }
Esempio n. 3
0
 internal void StartStage(LogStage stage, DateTime creationTime)
 {
     this.currentStageLogEntry = new PolicyTipRequestLogger.LogEntry(stage, creationTime);
 }
Esempio n. 4
0
 internal void StartStage(LogStage stage)
 {
     this.StartStage(stage, DateTime.UtcNow);
 }
Esempio n. 5
0
 internal LogEntry(LogStage stage, DateTime creationTime)
 {
     this.Stage        = stage;
     this.creationTime = creationTime;
 }
Esempio n. 6
0
 internal LogEntry(LogStage stage) : this(stage, DateTime.UtcNow)
 {
 }
Esempio n. 7
0
 /// <summary>
 /// Logging the Exception.
 /// </summary>
 /// <param name="aiException"></param>
 /// <param name="aiStage"></param>
 public void Log(Exception aiException, LogStage aiStage)
 {
     WriteLog(aiException, aiStage);
 }
Esempio n. 8
0
 /// <summary>
 /// Logging the message.
 /// </summary>
 /// <param name="aiMessage"></param>
 /// <param name="aiStage"></param>
 public void Log(string aiMessage, LogStage aiStage)
 {
     WriteLog(new Exception(aiMessage), aiStage);
 }
Esempio n. 9
0
 public FileLogger(LogStage aiStage)
 {
     LocalLogStage = aiStage;
 }