[Spice-devel] [PATCH spice-gtk 1/2] Use single log domain

Frediano Ziglio fziglio at redhat.com
Tue Mar 14 14:22:59 UTC 2017


> 
> On Tue, 2017-03-14 at 08:25 -0400, Frediano Ziglio wrote:
> > > 
> > > g_debug uses G_LOG_DOMAIN, spice_debug uses SPICE_LOG_DOMAIN
> > > Make them use only one domain - GSpice
> > > ---
> > >  src/Makefile.am | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/src/Makefile.am b/src/Makefile.am
> > > index 4fa7357..1043dbe 100644
> > > --- a/src/Makefile.am
> > > +++ b/src/Makefile.am
> > > @@ -71,6 +71,7 @@ KEYMAP_CSV = keycodemapdb/data/keymaps.csv
> > >  SPICE_COMMON_CPPFLAGS =
> > > \
> > >  	-DSPICE_COMPILATION
> > > \
> > >  	-DG_LOG_DOMAIN=\"GSpice\"
> > > \
> > > +	-DSPICE_LOG_DOMAIN=G_LOG_DOMAIN
> > > \
> > >  	-DSPICE_GTK_LOCALEDIR=\"${SPICE_GTK_LOCALEDIR}\"	\
> > >  	-DPNP_IDS=\""$(PNP_IDS)"\"
> > > \
> > >  	-DUSB_IDS=\""$(USB_IDS)"\"
> > > \
> > 
> > Maybe would be better to avoid to use SPICE_LOG_DOMAIN in spice-
> > common
> > and use directly G_LOG_DOMAIN ?
> we would have to adjust the server code accordingly
> 
> > 
> > Or change
> > 
> > #ifndef SPICE_LOG_DOMAIN
> > #define SPICE_LOG_DOMAIN "Spice"
> > #endif
> > 
> > to
> > 
> > #ifndef SPICE_LOG_DOMAIN
> > #  ifdef G_LOG_DOMAIN
> > #    define SPICE_LOG_DOMAIN G_LOG_DOMAIN
> > #  else
> > #    define SPICE_LOG_DOMAIN "Spice"
> > #  endif
> > #endif
> 
> looks good to me
> 
> Pavel
> 

Does it actually make sense to have SPICE_LOG_DOMAIN and G_LOG_DOMAIN
both defined and different?

Maybe we can decide one and have a more strong

#ifdef SPICE_LOG_DOMAIN
#error Please use G_LOG_DOMAIN instead
#endif


Frediano


More information about the Spice-devel mailing list