[Spice-devel] [spice-common v3 2/7] log: Use glib for logging

Christophe Fergeau cfergeau at redhat.com
Tue Jan 19 09:03:07 PST 2016


On Wed, Dec 16, 2015 at 03:05:07PM +0100, Victor Toso wrote:
> Hi,
> 
> On Wed, Dec 16, 2015 at 02:27:08PM +0100, Christophe Fergeau wrote:
> > spice-common has been duplicating glib logging methods for a long while.
> > Now that spice-common is depending on glib, it's more consistent to use
> > glib logging too. However, the code base is still using spice logging
> > functions.
> > This commit aims to make spice logging go through glib logging system,
> > while keeping the same behaviour for the SPICE_ABORT_LEVEL and
> > SPICE_DEBUG_LEVEL environment variables. They are deprecated however in
> > favour of the glib alternatives (G_DEBUG and G_MESSAGES_DEBUG).
> 
> Have you consider using G_LOG_DOMAIN for default domain?

This would require more changes in spice/spice-gtk, as we cannot do
#ifndef G_LOG_DOMAIN
#define G_LOG_DOMAIN "foo"
#endif

because by the time log.h is included, glib.h has most likely been
included already by another header, and glib.h sets G_LOG_DOMAIN to ""
if it's not already set. I think it's better to keep these patches
self-contained for now, the default log domain can be changed at a later
point.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20160119/2aa78ce1/attachment.sig>


More information about the Spice-devel mailing list