Summary: | libwayland: the library should not print anything to stderr | ||
---|---|---|---|
Product: | Wayland | Reporter: | nfxjfg |
Component: | wayland | Assignee: | Wayland bug list <wayland-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
nfxjfg
2014-01-07 00:14:18 UTC
http://cgit.freedesktop.org/wayland/wayland/commit/?id=52a77fca573705b6ac9b0e23747feea83740ab2f should fix part of the prints, but I guess the message you referred to is still there? OTOH, see http://cgit.freedesktop.org/wayland/wayland/commit/?id=a7524ed0d4cc4fcf8a0c5201618a4dfcd20f9499 which is going the opposite way. Is that ok? libwayland has at least 3 different libraries. Well, you're almost there. Remember how xlib had only a process wide error handler, and everyone hated it? You're making the same mistake. This is a very common mistake library designers do, and many libraries suffer from this mistake - or rather, libraries using other libraries suffer from it, because now they have to fight with other libraries for the log callback. That everyone makes this error doesn't make it any less wrong. I suggest that wl_log gets a context argument, and that the wl_log_handler can be set per-context by the library user. (Maybe this is less severe than the xlib issue, because wl_log_handler really is only a log function and not more, but still.) wl_log is only for logging not for handling protocol errors. If we add a mechanism for handling protocol errors, it will be a per-object handler. With that, this handles the remaining stderr printing: commit 88f3bd84c8ea8f0b3526f970388ef76baa231fe2 Author: Kristian Høgsberg <krh@bitplanet.net> Date: Wed Apr 30 12:18:52 2014 -0700 Avoid printing to stderr Use wl_log in the last few places where we print to stderr. Remove logging in a couple of places where we properly return an error code. https://bugs.freedesktop.org/show_bug.cgi?id=73339 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.