-
Notifications
You must be signed in to change notification settings - Fork 5
Output stacktrace on debug logging #517
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
Conversation
boarnoah
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth deliberately throwing a random exception in a local build -- to verify that it looks good
@boarnoah Yeah I did, looks like: The trace is a little bloated with all the builder extensions though but not sure if there is a way to omit them? |
|
Looks fine to me, not worth the effort to trim stack trace (and its only ever visible when someone enables debug mode to get detailed traces anyway) |
| if( BmxEnvironment.IsDebug ) { | ||
| messageWriter.WriteError( $"[DEBUG] Exception: {exception.GetType().Name} - {exception.Message}" ); | ||
| messageWriter.WriteError( | ||
| $"[DEBUG] Exception: {exception.GetType().Name} - {exception.Message}\n{exception.StackTrace ?? string.Empty}" ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This used to be simply exception.ToString()
Line 272 in 310dbe2
| consoleWriter.WriteError( exception.ToString() ); |
and it worked well enough.
I don't see why it shouldn't be kept the same, maybe only adding the prefix "[DEBUG] Exception:"
Why
Want to include stack trace to the debug output
Ticket
HOD-4002