Skip to content

Show Exceptions in greater detail#19

Open
arp6333 wants to merge 5 commits intoerizet:masterfrom
arp6333:master
Open

Show Exceptions in greater detail#19
arp6333 wants to merge 5 commits intoerizet:masterfrom
arp6333:master

Conversation

@arp6333
Copy link

@arp6333 arp6333 commented Oct 22, 2019

Thanks for the great NLogViewer, has helped me a ton. My main problem was that I wanted the ability to view Exceptions in full detail which I have done in a simple way using a popup. When an Exception / Error is logged with the exception passed with the message, for example:

catch (MyException ex) 
{ 
    logger.Error(ex, "Got exception.");
}

the NLogViewer will look the same, but the logged ListViewItem can be clicked on like so to open a popup and display the full exception:

exceptionpopup

The popup is closed using the red X or by clicking off of it. This helps debugging by displaying long and detailed errors in full.

My code also has one minor change that has the Message column wrap text so longer messages will not have to make the user scroll horizontally forever. This also allowed the Message column to fill the length of the screen when the screen is resized and gives the popup the same width as the NLogViewer. This change was to remove any unnecessary scrolling and to have the NLogViewer fit whatever width it was put into.

longmessagelogged

My examples have the LoggerName and Level columns removed but that was only because my program does not need to display them, these changes will still work with those columns in use.

@erizet
Copy link
Owner

erizet commented Nov 15, 2019

Thank you for this PR. I think it's a great add on to the library.
But I think I found a bug when testing it. When modifyning the sample to log a exception it shows the popup correctly, but if the window is maximized the pop up only flashes for a short while at the bottom of the screen.
If you fix this bug I'll merge this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants