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

Added color by status code #29 #50

Merged
merged 1 commit into from
Oct 27, 2021

Conversation

ChandanChainani
Copy link
Contributor

@ChandanChainani ChandanChainani commented Oct 24, 2021

image

@phra
Copy link
Owner

phra commented Oct 25, 2021

can you attach an example of the output result? thanks!

@ChandanChainani
Copy link
Contributor Author

ChandanChainani commented Oct 25, 2021

@phra I have attached the screenshot

Only added color in dir status code, didn't added the response size.

@phra phra self-requested a review October 26, 2021 23:20
Copy link
Owner

@phra phra left a comment

Choose a reason for hiding this comment

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

can you add console to to Cargo.toml?

@ChandanChainani
Copy link
Contributor Author

@phra Sorry i forgot to include the dependency added as mentioned.

return style(code).green().to_string();
}
else if code.starts_with("3") {
return style(code).magenta().to_string();
Copy link
Owner

Choose a reason for hiding this comment

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

I think yellow makes more sense for 3xx

return style(code).magenta().to_string();
}
else if code.starts_with("4") {
return style(code).yellow().to_string();
Copy link
Owner

Choose a reason for hiding this comment

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

Maybe orange better fits 4xx

@ChandanChainani ChandanChainani force-pushed the color_by_status_code branch 3 times, most recently from 2eb4f37 to d16c19b Compare October 27, 2021 04:53
used console cargo v0.15.0 for coloring the output in terminal
@ChandanChainani
Copy link
Contributor Author

ChandanChainani commented Oct 27, 2021

@phra updated 3xx and 4xx status color as mentioned

image

@ChandanChainani ChandanChainani requested a review from phra October 27, 2021 05:56
Copy link
Owner

@phra phra left a comment

Choose a reason for hiding this comment

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

LGTM

@phra phra merged commit 4a243d4 into phra:master Oct 27, 2021
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.

2 participants