Re: [PATCH spice-gtk v3] Remove unnecessary debug check from SPICE_DEBUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

----- Original Message -----
> On Fri, 2017-06-09 at 14:29 -0400, Marc-André Lureau wrote:
> > Hi
> > 
> > ----- Original Message -----
> > > Hi
> > > 
> > > ----- Original Message -----
> > > > > If I was reading the code of a project and noticed that they
> > > > > checked a
> > > > > global variable every time before calling g_debug(), I would
> > > > > find that
> > > > > very odd. For example:
> > > > > 
> > > > > void foo(void)
> > > > > {
> > > > >     if (foo_get_debug()) {
> > > > >         g_debug("something happened");
> > > > >     }
> > > > >     ...
> > > > > }
> > > > > 
> > > > > Nobody does this.
> > > 
> > > Actually, that's what GTK_DEBUG_CHECK does for ex.
> > > #define GTK_DEBUG_CHECK(type) G_UNLIKELY (gtk_get_debug_flags () &
> > > GTK_DEBUG_##type)
> > 
> > I should add that the macro is not used for logging, but to check
> > whether we should log something. (similar, except that there is no
> > category/flag in spice yet).
> 
> So where does that leave this patch? I can't tell if you still disagree
> with it, or if you think it's OK.

I don't mind much if we change the code to always call glog (could have been done when G_MESSAGES_DEBUG was introduced)

But we will reintroduce log/category checking soon anyway :)
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]