Conversation
|
@flosse I see that 2b8e6cc basically reverted the CI changes of #21, was that intensional? The benefit of If that is still something that you think would be good to have, commit aa12095 on this branch fixes the usage of |
|
I still don't understand why the log crate has to be disabled. It's just an API that is only used if you also have a logger. And if you want something of your own, you just need to implement it: https://docs.rs/log/latest/log/#implementing-a-logger |
This project introduced a breaking change in a version change from |
In my application I do have a logger and I do have logs of my own, but I'm not interested by the logs that are emitted by this crate and would rather disable them. After all, I want to be able to controll what shows up in the log.
This is not about implementing my own logging, just the abillity to disable the logs created by this crate.
I hear you, a breaking change like that, especially on a semver stable version change, is really not a good sign. I am hoping that they will get at least some negative feedback and learn their lesson to not do it again. We could also pin the version to prevent any possible future breaking update like that.
In terms of spending time, no extra time would be required since I already found the necessary changes in aa12095. In my opinion it is still worth using this create, since manually creating CI jobs for all feature permutations is both annoying to maintain and easy to mess up. If you still don't want to use that crate, I understand. Please let me know and I will remove the relevant commit. |
I see. I took your commit and tried to adjust it in #29 but I wanted to get rid of the deprecated |
Sure, but why do you need to use a feature flag for this? From https://docs.rs/log/latest/log/:
so by not using the facade you implicitly disable it anyway.
Don't get me wrong, I don't want to slow you down, but do you have a specific example where you are currently unable to write your own custom logs? |
Yeah, there is a missunderstanding somewhere. Let me try to clarify: I do want to use the The So in short, I think the missunderstanding is that there is no easy way of diabling the logging from this crate that allows to use the log crate for my own logging.
My specific example is a program based on the embassy cratesrunning on a microcontroller that uses UART for logging, similat to how the // [...]
log::info!("Some usefull log message");
// [...]
loop {
// [...]
match modbus_core::codec::tcp::client::decode_response(buffer) {
Ok(response) => handle_response(response),
Err(error) => if some_condition {
// do something else
} else {
log::warn!("My own error message: {error:?}");
}
}
}
We could somehow add a parameter to controll this, but in my case I never want any log except my own. Adding a parameter for that also feels very clunky, since there are no default arguments in Rust. On top of that, even if it is not the case for my current project, some microcontrollers have very limited flash space available so every byte counts. Being able to remove dependencies and unwanted code via a feature can be really helpfull in those cases. |
2d4460a to
b24deb6
Compare
|
All right, now I understand. Thank you for your patience and detailed explanation 🙏 |
An application may want to do it's own logging using the returned errors.