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

feat: replace custom log with env_logger #199

Merged
merged 1 commit into from
Dec 11, 2022

Conversation

brianmcgee
Copy link
Member

@brianmcgee brianmcgee commented Dec 11, 2022

For the most part this is a like for like replacement which adds colorized output but with two minor deviations from master.

Log format

The log output does not include a : after the log level:

# before
[DEBUG]: load config: 1.68ms (Δ 1.68ms)
[DEBUG]: Found elm-format at /nix/store/ph20y12g5bi2d3xqfyv939v295w9w45s-elm-format-0.8.5/bin/elm-format
[DEBUG]: built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 1 required extensions, 0 regexes
[DEBUG]: Found gofmt at /nix/store/81hx17lnmjafllfl1125g4n8qgwp5j9w-go-1.18.5/bin/gofmt

# after
[DEBUG] load config: 1.72ms (Δ 1.72ms)
[DEBUG] Found elm-format at /nix/store/ph20y12g5bi2d3xqfyv939v295w9w45s-elm-format-0.8.5/bin/elm-format
[DEBUG] built glob set; 0 literals, 0 basenames, 0 extensions, 0 prefixes, 0 suffixes, 1 required extensions, 0 regexes
[DEBUG] Found gofmt at /nix/store/81hx17lnmjafllfl1125g4n8qgwp5j9w-go-1.18.5/bin/gofmt

Verbosity flag

The version in master does not respect the number of times a -v flag is set: -v, -vv, and -vvv etc all result in the same log level: TRACE.

This version does respect the -v flag:

https://github.com/brianmcgee/treefmt/blob/a4aca2f1ce8b71d500d13e86d149e613e4c3feb2/src/main.rs#L17-L26

Closes #163, closes #196

@brianmcgee brianmcgee requested a review from zimbatm December 11, 2022 13:25
Copy link
Member

@zimbatm zimbatm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good!

@zimbatm zimbatm merged commit 897bf11 into numtide:master Dec 11, 2022
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.

Removal of custom log and use env_logger (or similar) instead Feature: Colorized Output in shell
2 participants