Skip to content

Commit

Permalink
Merge pull request #86 from R2NorthstarTools/Test-New-Log-Details
Browse files Browse the repository at this point in the history
Test new log details
  • Loading branch information
BigSpice authored Feb 4, 2024
2 parents f363eac + 4b0bd50 commit f9e1cda
Show file tree
Hide file tree
Showing 29 changed files with 1,548 additions and 886 deletions.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.metadata.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/ProjectEvaluation/vtol.projects.v7.bin
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified VTOL_2.0.0/.vs/VTOL/v17/.futdcache.v2
Binary file not shown.
62 changes: 43 additions & 19 deletions VTOL_2.0.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,17 @@ public string ProductVersion
return file.Substring(0, file.IndexOf("+") + 1).Replace("+", "");
}
catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");

}
{
var st = new System.Diagnostics.StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
var method = frame.GetMethod().Name;
var className = frame.GetMethod().DeclaringType.Name;
var variables = ""; // You would need to add logic to capture variable values

Log.Fatal(ex, $"An error occurred at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}" +
$" Line Number: {line}, Method Name: {method}, Class Name: {className}, Variables: {variables}" +
$"{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");}
return "1.0.0";

}
Expand Down Expand Up @@ -758,12 +765,17 @@ private void Log_Folder_warning_Click(object sender, RoutedEventArgs e)

}
catch (Exception ex)
{
{
var st = new System.Diagnostics.StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
var method = frame.GetMethod().Name;
var className = frame.GetMethod().DeclaringType.Name;
var variables = ""; // You would need to add logic to capture variable values

Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");


}
Log.Fatal(ex, $"An error occurred at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}" +
$" Line Number: {line}, Method Name: {method}, Class Name: {className}, Variables: {variables}" +
$"{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");}
}

private void Main_Win_Control_GotFocus(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -842,9 +854,17 @@ private void Changelog_Click(object sender, RoutedEventArgs e)


catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");
}
{
var st = new System.Diagnostics.StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
var method = frame.GetMethod().Name;
var className = frame.GetMethod().DeclaringType.Name;
var variables = ""; // You would need to add logic to capture variable values

Log.Fatal(ex, $"An error occurred at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}" +
$" Line Number: {line}, Method Name: {method}, Class Name: {className}, Variables: {variables}" +
$"{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");}
}

private void Troubleshoot_Click(object sender, RoutedEventArgs e)
Expand Down Expand Up @@ -1053,13 +1073,17 @@ private void Main_Win_Control_StateChanged(object sender, EventArgs e)
}

catch (Exception ex)
{
Log.Error(ex, $"A crash happened at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");




}
{
var st = new System.Diagnostics.StackTrace(ex, true);
var frame = st.GetFrame(0);
var line = frame.GetFileLineNumber();
var method = frame.GetMethod().Name;
var className = frame.GetMethod().DeclaringType.Name;
var variables = ""; // You would need to add logic to capture variable values

Log.Fatal(ex, $"An error occurred at {DateTime.Now.ToString("yyyy - MM - dd HH - mm - ss.ff", CultureInfo.InvariantCulture)}" +
$" Line Number: {line}, Method Name: {method}, Class Name: {className}, Variables: {variables}" +
$"{Environment.NewLine}{ex.InnerException}{Environment.NewLine}");}


}
Expand Down
Loading

0 comments on commit f9e1cda

Please sign in to comment.