Re: [PATCH spice-common 1/2] log: remove deprecated SPICE_ABORT_LEVEL support

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

 



> On Tue, Jan 29, 2019 at 10:49:23AM +0000, Frediano Ziglio wrote:
> > This feature was marked obsolete by efd1d3cb4d8eee more than
> > three years ago.
> > 
> > Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> > ---
> >  common/log.c         | 30 +-----------------------------
> >  tests/test-logging.c | 39 +--------------------------------------
> >  2 files changed, 2 insertions(+), 67 deletions(-)
> > 
> > diff --git a/common/log.c b/common/log.c
> > index a7806c5..5819974 100644
> > --- a/common/log.c
> > +++ b/common/log.c
> > @@ -33,11 +33,7 @@
> >  #include "backtrace.h"
> >  
> >  static int glib_debug_level = INT_MAX;
> > -static int abort_mask = 0;
> > -
> > -#ifndef SPICE_ABORT_MASK_DEFAULT
> > -#define SPICE_ABORT_MASK_DEFAULT (G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR)
> > -#endif
> > +static const int abort_mask = G_LOG_LEVEL_CRITICAL|G_LOG_LEVEL_ERROR;
> 
> after this commit, abort_mask is used in spice_logv:
> 
>       g_log(log_domain, log_level, "%s", log_msg->str);
> 
>       if ((abort_mask & log_level) != 0) {
>           spice_backtrace();
>           abort();
>       }
> 
> This allows to keep spice_critical() behaviour which aborts contrary to
> g_critical() which does not abort by default. I'm quite sure that
> G_LOG_LEVEL_ERROR will cause g_log() to abort.
> In other words, I think you could get rid of abort_mask and just use:
>       if ((log_level & G_LOG_LEVEL_CRITICAL) != 0) {
>           spice_backtrace();
>           abort();
>       }

Sure, maybe the abort output would be a bit different but I agree

> 
> Looks good even without this change,
> 
> Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>
> 
> 

Thanks,
  Frediano
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




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