lumberdash
lumberdash copied to clipboard
Make logError easier human readable in console
The current output of logError in console is hard to scan.
flutter: [ERROR] { exception: An error occured, stacktrace: #0 Auth0Authentication.refreshLogin.<anonymous closure> (package:my_app/authenticate/auth0_authentication.dart:168:11)
<asynchronous suspension>
#1 Auth0Authentication.refreshLogin.<anonymous closure> (package:my_app/authenticate/auth0_authentication.dart)
#2 Auth0Authentication.refreshLogin (package:my_app/authenticate/auth0_authentication.dart:172:6)
#3 SessionManager.autoLogin (package:my_app/src/session/session_manager.dart:39:36)
<asynchronous suspension>
- The log message doesn't start with the error message but with
{ exception: - The first list of the stacktrace is in the same line as the message pushing the important part out of view (without softwrap)
- Not having
#0at the beginning of the line breaks the parsing of stacktraces for tools. IntelliJ isn't able to collapse long stacktraces.
The proposed changed adds a newline before the stacktrace starts and removes the curly braces. The output of this change looks like this:
flutter: [ERROR] Auth0 lib failed while parsing the auth0 error response
#0 Auth0Authentication.refreshLogin.<anonymous closure> (package:my_app/authenticate/auth0_authentication.dart:168:11)
<asynchronous suspension>
#1 Auth0Authentication.refreshLogin.<anonymous closure> (package:my_app/authenticate/auth0_authentication.dart)
#2 Auth0Authentication.refreshLogin (package:my_app/authenticate/auth0_authentication.dart:172:6)
#3 SessionManager.autoLogin (package:my_app/src/session/session_manager.dart:39:36)
<asynchronous suspension>
#4 runhApp.<anonymous closure>.<anonymous closure> (package:my_app/app/app.dart:105:30)
<asynchronous suspension> [4 more...]
- [x] The error message is easy to read
- [x] Stacktrace line
#0starts at new line - [x] IntelliJ collapsing works
@jorgecoca @felangel push. Is anyone of you still maintaining this project?
@tchabot22 @dakrawczyk can you folks take a look (and resolve the pipeline issue)? Thanks!
@dakrawczyk any chance you can push this PR forward ?
@passsy could you rebase on the base branch so it's ready to be merged ?