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

Make logError easier human readable in console #52

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

passsy
Copy link

@passsy passsy commented Jul 13, 2020

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>
  1. The log message doesn't start with the error message but with { exception:
  2. The first list of the stacktrace is in the same line as the message pushing the important part out of view (without softwrap)
  3. Not having #0 at 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...]
  • The error message is easy to read
  • Stacktrace line #0 starts at new line
  • IntelliJ collapsing works

@passsy
Copy link
Author

passsy commented Sep 4, 2020

@jorgecoca @felangel push. Is anyone of you still maintaining this project?

@jorgecoca jorgecoca requested review from dakrawczyk and tchabot22 and removed request for JenniferJesuraj September 4, 2020 14:27
@jorgecoca
Copy link
Contributor

@tchabot22 @dakrawczyk can you folks take a look (and resolve the pipeline issue)? Thanks!

@tlvenn
Copy link

tlvenn commented Jan 6, 2021

@dakrawczyk any chance you can push this PR forward ?

@tlvenn
Copy link

tlvenn commented Jan 6, 2021

@passsy could you rebase on the base branch so it's ready to be merged ?

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

Successfully merging this pull request may close these issues.

4 participants