Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new log details #86

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading