Skip to content

Commit

Permalink
Click on exception indicator to show the log
Browse files Browse the repository at this point in the history
  • Loading branch information
KirillOsenkov committed Sep 2, 2024
1 parent 6729a12 commit da462e3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/StructuredLogViewer/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
VerticalAlignment="Top">
<TextBlock x:Name="exceptionText"
Padding="8,2,8,2"
MouseDown="ExceptionText_MouseDown"
ToolTip="Click to show the exception log"
>Exception:</TextBlock>
<Button x:Name="closeExceptionButton"
Click="CloseException_Click"
Expand Down
5 changes: 5 additions & 0 deletions src/StructuredLogViewer/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1093,6 +1093,11 @@ private void CloseException_Click(object sender, RoutedEventArgs e)
ExceptionText = null;
}

private void ExceptionText_MouseDown(object sender, MouseButtonEventArgs e)
{
Process.Start(ErrorReporting.LogFilePath);
}

private string currentExceptionText;
public string ExceptionText
{
Expand Down
2 changes: 2 additions & 0 deletions src/StructuredLogger/ErrorReporting.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ public class ErrorReporting
{
private static readonly string logFilePath = Path.Combine(PathUtils.RootPath, "LoggerExceptions.txt");

public static string LogFilePath => logFilePath;

public static void ReportException(Exception ex)
{
if (ex == null)
Expand Down

0 comments on commit da462e3

Please sign in to comment.