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

Switch to standard logging library #218

Merged
merged 7 commits into from
Apr 18, 2020
Merged

Conversation

RReverser
Copy link
Contributor

This allows to configure or compile away logging in the library from a single place in Rust apps.

For the CLI side, the usage and output remained the same, except it's now colour-coded.

Fixes #217.

This allows to configure or compile away logging in the library from a single place in Rust apps.

For the CLI side, the usage and output remained the same, except it's now colour-coded.

Fixes shssoichiro#217.
@RReverser
Copy link
Contributor Author

(fixing tests)

@RReverser
Copy link
Contributor Author

Fixed tests, also expanded verbose_mode test to verify that we produce expected verbose logs.

@RReverser
Copy link
Contributor Author

For the CLI side, the usage and output remained the same, except it's now colour-coded.

To show an example - this is what I mean by colour-coded (specific colours depend on the terminal theme, of course):
image

Copy link
Owner

@shssoichiro shssoichiro left a comment

Choose a reason for hiding this comment

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

Thanks! Just one small nitpick

src/lib.rs Outdated Show resolved Hide resolved
Co-Authored-By: Josh Holmer <[email protected]>
@@ -695,7 +670,7 @@ fn optimize_png(
}
}

eprintln!(
error!(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@shssoichiro By the way, I'm not sure whether it's worth keeping this log message if it's duplicate in an actual error too (and will be printed e.g. by CLI app twice). Thoughts?

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not entirely sure. But theoretically this should never show up, and if it does, we'll definitely want the user to be aware of it. So I think it's fine to leave it.

@shssoichiro shssoichiro merged commit 23ae9c3 into shssoichiro:master Apr 18, 2020
@RReverser RReverser deleted the log branch April 18, 2020 23:00
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.

Switch to standard logging approach
2 participants