[PATCH weston v2 2/2] compositor: Implement JSON-timeline logging

Pekka Paalanen ppaalanen at gmail.com
Mon Dec 8 05:04:46 PST 2014


On Thu, 4 Dec 2014 13:23:57 +0200
Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Tue, 02 Dec 2014 12:12:28 -0800
> Bill Spitzak <spitzak at gmail.com> wrote:
> 
> > On 12/02/2014 05:45 AM, Pekka Paalanen wrote:
> > > From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
> > 
> > > +	if (!s->get_label || s->get_label(s, d, sizeof(d)) < 0) {
> > > +		d[0] = '\0';
> > > +		q = "";
> > > +	}
> > > +
> > > +	fprintf(ctx->out, "{ \"id\":%u, "
> > > +		"\"type\":\"weston_surface\", "
> > > +		"\"desc\":%s%s%s%s }\n",
> > > +		s->timeline.id, q, d[0] ? d : "null", q, mainstr);
> > 
> > I think you should make an emit(FILE*, const char*) function that prints 
> > a quoted string or null, instead of doing this repeatedly. Such a 
> > function could also convert non-printable characters to escape sequences.
> 
> Yeah, not a bad idea.

Just did the simplification, and pushed these two patches. It will
break the JSON data if a window title contains unexpected characters,
but that can be fixed later if it turns out to be a problem.

Thanks,
pq


More information about the wayland-devel mailing list