From 5bf030a1137f09e9d9898c8a837e49a1af0468f9 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Mon, 29 Oct 2018 15:08:39 +0200 Subject: Improved some aspects of machine service and machine update. --- .../Tango.Logging/ExceptionLogItem.cs | 25 +++++++++++++++++++++- Software/Visual_Studio/Tango.Logging/LogManager.cs | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'Software/Visual_Studio/Tango.Logging') diff --git a/Software/Visual_Studio/Tango.Logging/ExceptionLogItem.cs b/Software/Visual_Studio/Tango.Logging/ExceptionLogItem.cs index de8485249..d2a1a352d 100644 --- a/Software/Visual_Studio/Tango.Logging/ExceptionLogItem.cs +++ b/Software/Visual_Studio/Tango.Logging/ExceptionLogItem.cs @@ -29,7 +29,30 @@ namespace Tango.Logging { get { - return Exception.Message; + if (Exception is AggregateException) + { + try + { + String message = String.Empty; + + if (Description != null) + { + message += Description + Environment.NewLine; + } + + message += String.Join(Environment.NewLine, (Exception as AggregateException).InnerExceptions.Select(x => x.Message)); + + return message; + } + catch + { + return Exception.Message; + } + } + else + { + return Exception.Message; + } } set { } } diff --git a/Software/Visual_Studio/Tango.Logging/LogManager.cs b/Software/Visual_Studio/Tango.Logging/LogManager.cs index b67128a8d..04c66a71f 100644 --- a/Software/Visual_Studio/Tango.Logging/LogManager.cs +++ b/Software/Visual_Studio/Tango.Logging/LogManager.cs @@ -123,7 +123,7 @@ namespace Tango.Logging log.TimeStamp = DateTime.Now; log.Exception = e; log.Category = category; - log.Description = description != null ? description : e.ToString(); + log.Description = description; AppendLog(log); -- cgit v1.3.1