Exemplo n.º 1
0
 private void LogExceptionVerbose(string message, Exception exception)
 {
     if (exception.GetType() == typeof(AggregateException))
     {
         foreach (Exception iex in (exception as AggregateException).Flatten().InnerExceptions)
         {
             this.LogExceptionVerbose(message, iex);
         }
     }
     else
     {
         FileLogger.LogError(message, exception);
         this.logger.LogMessage(MessageImportance.Low, string.Format(CultureInfo.InstalledUICulture, "{0}: {1}", message, exception.Message));
     }
 }
Exemplo n.º 2
0
        internal void LogError(string message, Exception exception, params object[] args)
        {
            if (exception != null)
            {
                string        msg      = string.Format(CultureInfo.InvariantCulture, message, args);
                List <string> messages = new List <string>();
                messages.Add(msg);
                FormatExceptionMessage(exception, messages);

                FileLogger.LogError(string.Join(Environment.NewLine, messages), exception);
                this.logger.LogError(exception.Message);
                this.LogExceptionVerbose(msg, exception);
            }
            else
            {
                this.logger.LogError(message, args);
            }
        }
Exemplo n.º 3
0
 internal void LogErrorFromException(Exception ex)
 {
     FileLogger.LogError(string.Empty, ex);
     this.logger.LogErrorFromException(ex);
 }