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

Use extended brackets instead of box-drawing characters in log messages #33898

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

waldyrious
Copy link
Contributor

@waldyrious waldyrious commented Nov 20, 2019

This PR proposes using extended brackets instead of box-drawing characters in multi-line log messages. The box-drawing characters were first introduced in #25111.

This change improves formatting of multi-line log messages in two ways:

  • They become semantically consistent with the single-line log messages (which use the left bracket character, [)
  • They become more visually consistent with the single-line log messages, since the box drawing characters and have the horizontal section in the middle of the line, rather than at the top and the bottom like [.

With this change, the box drawing characters can now produce a left-flanking box that actually "wraps" the log message, (thus matching the style of the single-line log messages), rather than be slightly shorter than the text.

Current:

# Characters used:
# - '┌' Box Drawings Light Down and Right, U+250C
# - '│' Box Drawings Light Vertical, U+2502
# - '└' Box Drawings Light Up and Right, U+2514

┌ Info: parameters:
│   {UUID} = UUID("1a7ac041-bdf1-4da1-9e3a-91f6f6c88e92")
│   {PKGNAME} = "Foo"
│   {USERNAME} = "John Doe"
│   {USEREMAIL} = "[email protected]"
│   {GHUSER} = "jdoe"
└   {YEAR} = 2019
Confirm (Y)> 
[ Info: copy and substitute

Proposed:

# Characters used:
# - '⎡' Left Square Bracket Upper Corner, U+23A1
# - '⎜' Left Square Bracket Extension, U+23A2
# - '⎣' Left Square Bracket Lower Corner, U+23A3

⎡ Info: parameters:
⎜   {UUID} = UUID("1a7ac041-bdf1-4da1-9e3a-91f6f6c88e92")
⎜   {PKGNAME} = "Foo"
⎜   {USERNAME} = "John Doe"
⎜   {USEREMAIL} = "[email protected]"
⎜   {GHUSER} = "jdoe"
⎣   {YEAR} = 2019
Confirm (Y)> 
[ Info: copy and substitute

@waldyrious
Copy link
Contributor Author

waldyrious commented Nov 20, 2019

An alternative to make the printing of logs more consistent could be to go the other way and replace [ for single-line log messages with a simple hyphen -, or more appropriately, the box drawing character equivalent :

# Characters used:
# - '┌' Box Drawings Light Down and Right, U+250C
# - '│' Box Drawings Light Vertical, U+2502
# - '└' Box Drawings Light Up and Right, U+2514
# - '╶' Box Drawings Light Right, U+2576

┌ Info: parameters:
│   {UUID} = UUID("1a7ac041-bdf1-4da1-9e3a-91f6f6c88e92")
│   {PKGNAME} = "Foo"
│   {USERNAME} = "John Doe"
│   {USEREMAIL} = "[email protected]"
│   {GHUSER} = "jdoe"
└   {YEAR} = 2019
Confirm (Y)> 
╶ Info: copy and substitute

But honestly I prefer the first approach to this one.

@waldyrious
Copy link
Contributor Author

Pinging the author and reviewers of #25111: @fredrikekre, @c42f and @KristofferC.

@fredrikekre
Copy link
Member

IIRC we tried this but those characters did not render nicely on some systems. Maybe it was some other characters we tried though.

@fredrikekre fredrikekre added display and printing Aesthetics and correctness of printed representations of objects. logging The logging framework labels Nov 20, 2019
@KristofferC
Copy link
Member

Here is a screenshot on windows with the new characters to the right:

image

@waldyrious
Copy link
Contributor Author

waldyrious commented Nov 20, 2019

Ah, I feared that could happen. Alas, it's a font issue that we can't fix on Julia's side. 😞

Do you guys think it could be worth trying the alternate consolidation approach I mentioned above (or some other that may have been discussed somewhere)?

@Keno
Copy link
Member

Keno commented Nov 20, 2019

Just wanted to note that the box drawing characters have special support to look better on iTerm, so if we switch, somebody should validate that the alternative works there also.

@c42f
Copy link
Member

c42f commented Nov 20, 2019

I'm ok with a change of characters in principle, but I also think there's a high bar to pass in compatibility. If they don't render correctly out of the box on some systems I'd not want to change this.

I'm somewhat surprised the box drawing characters have worked out as well as they have TBH. Originally I had ascii for that reason; it's not pretty but it does work everywhere.

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. logging The logging framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants