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

Verbosity and Logging #19

Merged
merged 23 commits into from
Dec 15, 2023
Merged

Verbosity and Logging #19

merged 23 commits into from
Dec 15, 2023

Conversation

mxwt00
Copy link
Collaborator

@mxwt00 mxwt00 commented Dec 5, 2023

Implemented the --verbosity command flag and correct logging with log levels.
I had to alter the --verbosity flag a bit. I could not get Clap's parse(from_occurrences) to work correctly.
The log level is no longer increased with -v, -vv, ..., but instead by writing the log level as a String (for example --verbosity debug).

mxwt00 and others added 17 commits December 5, 2023 12:24
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
Signed-off-by: Satu Koskinen <satu.a.koskinen@gmail.com>
Signed-off-by: Max Winter <maxwinter00@gmail.com>
mxwt00 and others added 2 commits December 5, 2023 12:48
Signed-off-by: Max Winter <maxwinter00@gmail.com>
src/logging.rs Outdated Show resolved Hide resolved
src/logging.rs Outdated Show resolved Hide resolved
@juliuskoskela
Copy link
Contributor

I found this https://github.com/clap-rs/clap-verbosity-flag which implements standard behaviour for verobosity flag. What do you guys think?

@mxwt00
Copy link
Collaborator Author

mxwt00 commented Dec 5, 2023

I found this https://github.com/clap-rs/clap-verbosity-flag which implements standard behavior for verbosity flag. What do you guys think?

Ah that should probably work. I personally like the variant with the log level as string more, but i can change it to use this variant if you prefer that.

Signed-off-by: Max Winter <maxwinter00@gmail.com>
@juliuskoskela
Copy link
Contributor

In my opinion -v*** is so standard that it would be the first expectation in a CLI without reading documentation. I think here it's justified to take the most standard approach from usability perspective.

src/import.rs Outdated Show resolved Hide resolved
@mxwt00
Copy link
Collaborator Author

mxwt00 commented Dec 5, 2023

Alright, then i will try out the clap_verbosity_flag

src/main.rs Outdated Show resolved Hide resolved
src/main.rs Outdated Show resolved Hide resolved
Signed-off-by: Max Winter <maxwinter00@gmail.com>
src/import.rs Outdated Show resolved Hide resolved
@mxwt00 mxwt00 merged commit 846de4b into main Dec 15, 2023
1 check passed
@juliuskoskela juliuskoskela deleted the verbosity_and_logging branch December 16, 2023 15:27
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.

4 participants