Skip to content

fix: move log level padding outside brackets#1871

Merged
thomas-zahner merged 2 commits intolycheeverse:masterfrom
K-dash:fix/log-padding-outside-brackets-1868
Oct 11, 2025
Merged

fix: move log level padding outside brackets#1871
thomas-zahner merged 2 commits intolycheeverse:masterfrom
K-dash:fix/log-padding-outside-brackets-1868

Conversation

@K-dash
Copy link
Contributor

@K-dash K-dash commented Oct 11, 2025

Summary

Move log level padding from inside brackets to outside brackets for better visual appearance.

Before:

[WARN ] Test
[ERROR] Test

After:

[WARN]  Test
[ERROR] Test

Changes

Modified lychee-bin/src/formatters/log.rs to place padding after brackets instead of inside

Related Issue

Fixes #1868

@K-dash K-dash mentioned this pull request Oct 11, 2025
@thomas-zahner
Copy link
Member

@K-dash Thank you very much for the PR.
I double checked what to output looks like and realised that we might want the output to look different.

Previously

$ cargo run README.md -v

   [WARN ] Test
   [INFO ] Test
   [ERROR] Test
   [WARN ] Error creating request: InvalidPathToUri("/CONTRIBUTING.md")
     [200] file:///home/thomas/Projects/lychee/assets/yes.svg
     [200] file:///home/thomas/Projects/lychee/README.md#features
     [200] file:///home/thomas/Projects/lychee/docs/TROUBLESHOOTING.md

As you can see, it seems like the initial intention was to align the closing brackets ], that is to align it to the right. I didn't realise this until now.

This PR

   [WARN]  Test
   [INFO]  Test
   [ERROR] Test
   [WARN]  Error creating request: InvalidPathToUri("/CONTRIBUTING.md")
     [200] file:///home/thomas/Projects/lychee/README.md#installation

Proposal

Could you update the PR, so that the output looks as follows?

    [WARN] Test
    [INFO] Test
   [ERROR] Test
    [WARN] Error creating request: InvalidPathToUri("/CONTRIBUTING.md")
     [200] file:///home/thomas/Projects/lychee/assets/yes.svg
     [200] file:///home/thomas/Projects/lychee/README.md#features
     [200] file:///home/thomas/Projects/lychee/docs/TROUBLESHOOTING.md

Sorry for realising this only at this stage.

@K-dash
Copy link
Contributor Author

K-dash commented Oct 11, 2025

@thomas-zahner
Updated the formatting to right-align the log level brackets as suggested. Thanks for the feedback.

@thomas-zahner
Copy link
Member

Awesome, thank you for the contribution 👍

@thomas-zahner thomas-zahner merged commit 550cf18 into lycheeverse:master Oct 11, 2025
6 checks passed
@K-dash K-dash deleted the fix/log-padding-outside-brackets-1868 branch October 11, 2025 14:24
@mre mre mentioned this pull request Oct 10, 2025
This was referenced Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Log padding

2 participants