[Spice-devel] [PATCH] log: add not fatal spice_return function

Christophe Fergeau cfergeau at redhat.com
Tue Nov 24 04:02:15 PST 2015


On Mon, Nov 23, 2015 at 10:55:19AM -0600, Jonathon Jongsma wrote:
> On Fri, 2015-11-20 at 22:22 +0100, David Jaša wrote:
> > On Pá, 2015-11-20 at 16:26 +0100, Francois Gouget wrote:
> > > On Thu, 19 Nov 2015, Frediano Ziglio wrote:
> > > [...]
> > > > > What do you mean by "100% compatible with the current code"? (why is
> > > > > g_return_if-fail() not "100% compatible with the current code" ?)
> > > > 
> > > > well... implementation is quite different. I didn't get all differences
> > > > but
> > > > - spice_logv use some environment SPICE_* specific (I doubt Glib does!);
> > > > - Glib output on standard error or output based on level;
> > > > - surely something I forgot!
> > > 
> > > Does it matter?
> > > The client uses the g_return_xxx() functions already. Would it be a 
> > > problem if the server did too instead of going its separate way?
> > > 
> > 
> > Without accompanying modification, yes. Users are taught that
> > spice-server logging is controlled by SPICE_DEBUG_LEVEL environment
> > variable. Glib debugging is controlled differently so if you just start
> > mixing spice_* and g_* logging functions, users will start silently
> > losing some debugging information...
> 
> I don't think any debugging information will be lost. The g_return_* functions
> log a message with "critical" severity. And critical warnings are printed by
> default. It's true that the spice_return_* and g_return_* messages will be
> controlled by two different mechanisms, but by default I believe these messages
> will be visible. Of course, we should eventually standardize on a single
> approach (and provide compatibility with the old settings), but I don't think
> incremental changes will be a big problem.

The patch in
http://lists.freedesktop.org/archives/spice-devel/2015-November/024010.html
attempts to do that:
- makes spice_log (used by spice_warning and friends) use glib logging
- moves the necessary glib knobs when SPICE_ABORT_LEVEL /
  SPICE_DEBUG_LEVEL are set
- issue a warning pointing at the recommended glib environment variable
  when SPICE_*_LEVEL is used

The SPICE_*_LEVEL -> glib mapping is a bit crude, but it's probably
going to be good enough.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20151124/7f2bead2/attachment.sig>


More information about the Spice-devel mailing list