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

Add different verbosity levels #824

Merged
merged 2 commits into from
Nov 28, 2022
Merged

Add different verbosity levels #824

merged 2 commits into from
Nov 28, 2022

Conversation

mre
Copy link
Member

@mre mre commented Nov 11, 2022

More granular verbosity levels have been asked
for repeatedly.
To enable that we're moving to [env_logger] and [clap-verbosity-flag]
to provide more flexible verbosity settings.

Also tackles #661, #709.
Lays the groundwork for tackling #268 and #704.

https://github.com/rust-cli/env_logger
https://github.com/clap-rs/clap-verbosity-flag

More granular verbosity levels have been asked
for repeatedly.
To enable that we're moving to [env_logger] and [clap-verbosity-flag]
to provide more flexible verbosity settings.

Also tackles #661, #709
Lays the groundwork for tackling #268

https://github.com/rust-cli/env_logger
https://github.com/clap-rs/clap-verbosity-flag
@mre
Copy link
Member Author

mre commented Nov 11, 2022

If someone finds the time I'd love to get a review to avoid regressions.

@mre mre merged commit 982d978 into master Nov 28, 2022
@mre mre deleted the verbose-mode branch November 28, 2022 22:25
@mre mre mentioned this pull request Nov 28, 2022
@tooomm
Copy link
Contributor

tooomm commented Dec 4, 2022

Is there some brief explanation somewhere? Which information do the various level add (v) or remove (q)?

@mre
Copy link
Member Author

mre commented Dec 12, 2022

At the moment it's pretty basic:

  • Verbose mode (-v) prints data URLs and false-positive URLs (e.g. example.com, which is an IANA reserved domain).
  • Normal mode (without any -v) skips those.

That's it.
We could add something to the docs, but I don't know if it's worth it. Suggestions welcome.

@tooomm
Copy link
Contributor

tooomm commented Dec 12, 2022

Hmm, but what will -vv print then? Or -vvv?

Edit: I found some helpful comments in the code that have some more information: https://github.com/lycheeverse/lychee/blob/master/lychee-bin/src/verbosity.rs#L41-L46
From there, it also looks like -qq is not possible?

Ordinary users won't read the code. :)
Maybe the wordings on the command line parameters info can be tweaked a bit to give users some idea, without writing a full documentation.

@mre
Copy link
Member Author

mre commented Dec 12, 2022

Hmm, but what will -vv print then? Or -vvv?

So far this is not used, but reserved for future use-cases. It is already supported by the crate we use for checking verbosity, so it was no extra work to include it.

From there, it also looks like -qq is not possible?

-qq is possible, but doesn't change much. So far not even -q is used as I don't have a good use-case for that in mind.

Maybe the wordings on the command line parameters info can be tweaked a bit to give users some idea, without writing a full documentation.

That's fair. I'm willing to accept pull requests to help increase the clarity. Would you be interested? Alternatively we could write something about it on the website.

@tooomm
Copy link
Contributor

tooomm commented Dec 12, 2022

Thanks for your quick reply.
I can try to circle back to it during the holidays. 👍

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

Successfully merging this pull request may close these issues.

2 participants