Ejemplo n.º 1
0
 internal void EndStageAndTransitionToStage(LogStage stage)
 {
     this.EndStage();
     if (stage == LogStage.SendResponse)
     {
         this.StartStage(stage, this.creationTime);
         return;
     }
     this.StartStage(stage);
 }
Ejemplo 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");
         }
     }
 }
Ejemplo n.º 3
0
 internal void StartStage(LogStage stage, DateTime creationTime)
 {
     this.currentStageLogEntry = new PolicyTipRequestLogger.LogEntry(stage, creationTime);
 }
Ejemplo n.º 4
0
 internal void StartStage(LogStage stage)
 {
     this.StartStage(stage, DateTime.UtcNow);
 }
Ejemplo n.º 5
0
 internal LogEntry(LogStage stage, DateTime creationTime)
 {
     this.Stage        = stage;
     this.creationTime = creationTime;
 }
Ejemplo n.º 6
0
 internal LogEntry(LogStage stage) : this(stage, DateTime.UtcNow)
 {
 }
Ejemplo 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);
 }
Ejemplo 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);
 }
Ejemplo n.º 9
0
 public FileLogger(LogStage aiStage)
 {
     LocalLogStage = aiStage;
 }