-
Notifications
You must be signed in to change notification settings - Fork 30
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
Make log optional #141
Make log optional #141
Conversation
yea, it is ideal. I'm planning on a breaking change anyways since i switched from requiring slices for input to a generic trait T |
perfect! pushed the rest of the crates with the "log" being off by default. The only thing that concerned me - I changed log for zune_core in zune-imageprocs. Do not really know whats the relashionship between zune-imageprocs and zune_core and if that was a right thing to do. |
The reason it never used The imageprocs does image processing stuff- blurs, color manipulation etc. core mainly provides decoding and encoding routines like byte readers and writers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not particularly okay with printing to standard output. I.e it's a library and it wouldn't make sense to print warnings for something we can't really influence where it would be used.
I think if the user doesn't want logging, let us just silently fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done! warn and error are now panic and anything else is just nothing.
tbh as a user I would not mind info! and warn! to go into stderr
By default, with the "log" feature on "zune-core" will re-export the log crate.
Without "log", "zune-core" exports some stubs over
eprintln!
.The only change required for "zune-*" crate: use
zune_core::log::trace
instead oflog::trace
.To remove "log-rs" dependency in zune-image user's Cargo.toml:
I do not really like that it requires "x86" etc, but I guess its fine? Not having
log
as a default featulre will be a breaking change - for everyone who actually usedlog-rs
, all the logs fromzune
will suddenly disappear, not ideal.Let me know if the idea is OK, I'll finish this PR with the rest of "zune-*" crates.