fix exception logging

This commit is contained in:
Vincent Maas committed 2020-11-26 21:43:52 +01:00
1 parent 0c5d3b4eb8
commit f46fcbfbd4
4 files changed
+8 -7

No files matched your search

-2
View File
@@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.30128.74
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorControl", "ColorControl\ColorControl.csproj", "{A6005D08-70F0-44CB-A384-9219EBA84F21}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0373E1EF-1DE6-4BCB-BC95-2D7961DBA194}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+1 -1
View File
@@ -27,7 +27,7 @@
<ProductName>ColorControl</ProductName>
<PublisherName>Maassoft</PublisherName>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.3.3.0</ApplicationVersion>
<ApplicationVersion>1.3.4.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
+5 -2
View File
@@ -19,7 +19,10 @@ namespace ColorControl
public static string ToLogString(this Exception exception, string environmentStackTrace = "")
{
List<string> environmentStackTraceLines = ExceptionExtensions.GetUserStackTraceLines(environmentStackTrace);
environmentStackTraceLines.RemoveAt(0);
if (environmentStackTraceLines.Any())
{
environmentStackTraceLines.RemoveAt(0);
}
List<string> stackTraceLines = ExceptionExtensions.GetStackTraceLines(exception.StackTrace);
stackTraceLines.AddRange(environmentStackTraceLines);
@@ -46,7 +49,7 @@ namespace ColorControl
private static List<string> GetUserStackTraceLines(string fullStackTrace)
{
List<string> outputList = new List<string>();
Regex regex = new Regex(@"([^\)]*\)) in (.*):line (\d)*$");
Regex regex = new Regex(@"([^\)]*\)) in (.*):([A-z]*) (\d)*$");
List<string> stackTraceLines = ExceptionExtensions.GetStackTraceLines(fullStackTrace);
foreach (string stackTraceLine in stackTraceLines)
+2 -2
View File
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.3.0")]
[assembly: AssemblyFileVersion("1.3.3.0")]
[assembly: AssemblyVersion("1.3.4.0")]
[assembly: AssemblyFileVersion("1.3.4.0")]