[PATCH wayland 0/3] Add a debug handler for printing protocol

Pekka Paalanen ppaalanen at gmail.com
Thu Dec 19 00:17:49 PST 2013


On Wed, 18 Dec 2013 20:56:17 -0600
Jason Ekstrand <jason at jlekstrand.net> wrote:

> This series adds a wl_debug function and associated handler that can
> be set by the uesr.  The first patch is merely a rename to prepare
> for the third. The second adds a useful helper function used by the
> third.
> 
> Jason Ekstrand (3):
>   Rename wl_debug to debug_server/client
>   Add a wl_array_printf function for easy string formatting
>   Add a debug handler and use it to print out protocol debug messages

Hi,

this all looks nice. I guess the intention is that all compositors
implement a debug logger, and then WAYLAND_DEBUG=1/server cause it to
get filled. Clients OTOH are usually supposed to not have their own
handler, so that the debug spew gets to stderr as usual. Something like
that?

Some further (old) ideas:

- For server prints, it would be nice to be able to identify the
connection or the client.

- For client prints it would be nice to be able to identify the current
connection or process.

- wl_arrays might be nice to print out in the dump somehow.

- Strings are not escaped properly, so it is near impossible to write an
  automatic dump parser that would get string arguments always right
  regardless of their content.

Though, if this output is never intended to be machine-read, the latter
two don't matter.


Thanks,
pq


More information about the wayland-devel mailing list