Skip to content

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.

@DilumAluthge
Copy link
Member

This PR has had no activity for five years+, so I'll close it as stale.

@waldyrious If you're still interested in working on this PR, let me know, and I can re-open it.

@waldyrious
Copy link
Contributor Author

I'd be happy to drive this to the finish line. I believe the main concern was the font rendering issues, right? Perhaps @KristofferC can re-check whether the issues he noticed last time are still present? And of course, if anyone of the commenters who expressed this concern could also check on their systems, that would be great to give us reasonable confidence that we can move ahead with this.

If OTOH the rendering issues persist, I must regrettably agree to close the PR.

@DilumAluthge
Copy link
Member

@waldyrious Can you rebase against the latest Julia master, and fix the merge conflicts? That will give us new PR builds for use with Juliaup, and then folks can test this out again on a variety of systems.

@waldyrious waldyrious force-pushed the extended-brackets-in-logs branch from 6c53d82 to 32d0b45 Compare February 12, 2026 09:14
@waldyrious
Copy link
Contributor Author

@DilumAluthge I've rebased the branch and fixed the conflicts.

@DilumAluthge
Copy link
Member

Looks like there are some test failures in Logging:

Error in testset Logging:
Test Failed at /cache/build/tester-amdci5-14/julialang/julia-master/julia-32d0b45841/share/julia/stdlib/v1.14/Logging/test/runtests.jl:357
  Expression: total_entries == n * 3
   Evaluated: 0 == 30000
ERROR: LoadError: Test run finished with errors

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.

7 participants