[Spice-devel] [RFC PATCH] log: warn on spice_return*_if_fail instead of aborting
Alon Levy
alevy at redhat.com
Mon Oct 29 03:20:22 PDT 2012
> Hi
>
> ----- Mensaje original -----
> > Currently log level for spice_return_if_fail and
> > spice_return_val_if_failed
> > functions (#define macros really) is SPICE_LOG_LEVEL_CRITICAL.
> > By default spice abort level is SPICE_LOG_LEVEL_CRITICAL.
> > That means the program aborts upon a call to spice_return_if_fail
> > functions.
> >
> > This patch changes the log level for spice_return_if_fail functions
> > to SPICE_LOG_LEVEL_WARNING, such that a warning message
> > is written to log, and the program continues.
>
> This will differ from glib. The log level for g_return_if_fail is
> critical, but glib doesn't abort by default at this level, unless
> given G_DEBUG=fatal_criticals. The idea was to stay close to glib
> behaviour, in order to be easier to learn and easier to switch to
> glib eventually in the future.
>
> Imho, the Spice server shouldn't crash on critical either. This can
> be tuned at compile time or at run-time with the SPICE_ABORT_LEVEL.
>
> so small nack for the above reasons.
+1 to make critical not abort, explain that it is compatible to glib in commit message.
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
More information about the Spice-devel
mailing list