[Spice-devel] [RFC PATCH] log: warn on spice_return*_if_fail instead of aborting

Marc-André Lureau mlureau at redhat.com
Mon Oct 29 03:07:16 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.


More information about the Spice-devel mailing list