wayland-rs: Add more eprintln!() messages for protocol problems
In particular, rust-impl wayland-client should eprintln!() the issues when it encounters a problem with what the server has sent.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16 (16 by maintainers)
The problem is that is allocate memory but I least it’s work well.
It’s hard to answer these questions:
WAYLAND_DEBUGmust be transfer to the user control (some helper function not a big deal I think) cause user in Rust have the logging control, the library have no control.I understand the problems you raise so I think this would need a proof of concept PR to see what it’s could look like.
Use case:
We could also have a feature that initialize the logging system (for foreign code) in the same place where the crate already check the
WAYLAND_DEBUGbut it’s wrong to do that https://github.com/Smithay/wayland-rs/blob/c080f7519aa9e0ec60051f3342f90289c7c77cda/wayland-client/src/rust_imp/display.rs#L30We could use a feature that switch between the two logging strategy. That require more code.
We could not care.
I’m indecisive about that. These messages are printed in result of a protocol error, meaning that the connection is going to be closed, and in 99% of cases meaning the client will
panic!()becauseevent_queue.dispatch()returns an error.Also, such messages being triggered is 100% guaranteed to be because of a bug (either server-side or client-side), from my point of view they mostly would serve as additional context to a panic backtrace, so I’m not sure what would be actually gained from pulling in the
logmachinery, and requiring downstream apps to use it to see these messages.