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

Tweak stacktrace printing to increase prominence of filename:line info #40230

Conversation

nickrobinson251
Copy link
Contributor

Closes #40228

I think this would be a good resolution to #40228, but there are other options e.g. we could instead increase the configurability of printing, which we could discuss in #40228. Opening this to give us a concrete option (which i hope will be a minimally invasive one and help us avoid an extensive bikeshedding as i appreciate that a lot of thought has already gone into this).

This changes the display of the ~/path/to/filename:line from filename:line being underlined in :light_black to be displayed in the :normal color, thereby still giving it more importance that the rest of the filepath, while (hopefully) making it easier to read, and simplifying the UI by reducing the number of different grey-styles we have (from 4 to 3).

Dark theme example

Before

Screenshot 2021-03-27 at 12 48 49

After

Screenshot 2021-03-27 at 12 34 28

Light Theme example

Before

Screenshot 2021-03-27 at 12 58 21

After

Screenshot 2021-03-27 at 12 58 43

@KristofferC
Copy link
Member

FWIW, I think the current formatting should stay as the default for a while at least. With every cosmetic change, it takes a while for the brain to get used to it and until that has happened you can't really evaluate it fairly.

Personally, I find it easier to find the file name with the current formatting than the suggested one here because it is the only thing that is underlined. With the suggested printing here, the types in the arguments and the file name have the same formatting so they are harder to quickly separate.

@nickrobinson251
Copy link
Contributor Author

nickrobinson251 commented Mar 27, 2021

FWIW, I think the current formatting should stay as the default for a while at least. With every cosmetic change, it takes a while for the brain to get used to it and until that has happened you can't really evaluate it fairly.

Yeah, i think that's reasonable. And i think the biggest downside of the change in this PR is that it's a change at all i.e. more fidgeting about with the UI.

Just to say (as in #40228), i'm not searching for a further discussion on aesthetics, so much as trying to fix what for me is quite a significant issue with the new UI, which is that (i) some info that's very often important is printed in light_black and (ii) i can't read light_black (on my fairly standard dark theme background). So it's not so much that the appearance is new/different as that info is no longer easily visible to me. Since that's still somewhat specific to me, i'd also be happy with an option to change this only for me (but making such an option available might require a change in Base).

I'll see if i can put up another PR with a different option using ENV variables to disable colours in stacktraces.

thanks for the feedback

@nickrobinson251
Copy link
Contributor Author

I find it easier to find the file name with the current formatting than the suggested one here because it is the only thing that is underlined.

How about if it we kept it underlined but used the more prominent color?

Apart from the downside of it being a change, i do think this solution might be nicer than e.g. #40232

Examples

Screenshot 2021-03-27 at 17 50 13

Screenshot 2021-03-27 at 17 50 37

@kshyatt kshyatt added the display and printing Aesthetics and correctness of printed representations of objects. label Apr 13, 2021
@matthieugomez
Copy link
Contributor

@KristofferC There is a real issue when using a dark theme (such as dark Solarized) — line numbers are almost unreadable.
Screen Shot 2021-07-17 at 9 28 48 AM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve visibilty of line location in stacktrace e.g. Ability to override/disable muted colour in stacktraces
4 participants