Skip to content

Switch to standard logging approach #217

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

Closed
RReverser opened this issue Apr 17, 2020 · 0 comments · Fixed by #218
Closed

Switch to standard logging approach #217

RReverser opened this issue Apr 17, 2020 · 0 comments · Fixed by #218

Comments

@RReverser
Copy link
Contributor

Right now, lib.rs takes care of logging by printing all messages to eprintln when configured to do so via own verbosity option.

It might be better to switch to a standard logging facade compatible with rest of the ecosystem.

This way, users of the library could configure logging from a single place with any logging library of their preference. This would also allow them to configure verbosity from a single place, filter logs based on library, redirect any logs to the desired file, use logger that is specific to some targets like WebAssembly or Android, or even compiling debug logs away to no-op in case they don't want it to be present in the final artifact.

RReverser added a commit to RReverser/oxipng that referenced this issue Apr 17, 2020
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.
shssoichiro pushed a commit that referenced this issue Apr 18, 2020
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.
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 a pull request may close this issue.

1 participant