[Spice-devel] [PATCH spice-common 3/4] RFC: Add spice log categories

Marc-André Lureau marcandre.lureau at redhat.com
Mon Jun 12 18:50:56 UTC 2017


Hi

----- Original Message -----
> On Mon, Jun 12, 2017 at 05:41:26PM +0200, Christophe Fergeau wrote:
> > On Mon, Jun 12, 2017 at 12:19:53PM +0400, marcandre.lureau at redhat.com
> > wrote:
> > > From: Marc-André Lureau <marcandre.lureau at redhat.com>
> > > 
> > > A log category is defined with SPICE_LOG_CATEGORY(). The macro will
> > > register a structure with a constructor (and unregister it on
> > > unloading with a destructor).
> > > 
> > > spice_log_init() must be called at initialization time, to set enabled
> > > categories and add the 'Spice' glib domain to G_MESSAGES_DEBUG (NB: if
> > > useful, we could have other log domains automatically associated with
> > > categories and enable them too).
> > > 
> > > A category can be enabled with SPICE_DEBUG="cat_name foo*" (*? are
> > > accepted glob-like wildcards). All categories are enabled with
> > > SPICE_DEBUG=1 or 'all'. To list available categories, you can run the
> > > program with SPICE_DEBUG=help.
> > 
> > Not really a review, nor things to change right now, but
> > hopefully this can map to command-line arguments as well. Why " " as a
> > separator rather than ":"?
> 
> Ah ok, similar to G_MESSAGES_DEBUG which I wrongly assumed to be using ":" as
> a
> separator ;)

That's right! My first iteration had ':' for seperator, as it seemed more conventional to me, but then I thought it was better to follow glib for consistency, since you also need to manipulate G_MESSAGE_DEBUG in general.

Alternatively, we could support both, and perhaps suggest ':' to glib too (I don't think anyone uses : in glib domain names)


More information about the Spice-devel mailing list