[Spice-devel] [spice-common v2 1/7] log: Use glib for logging
Christophe Fergeau
cfergeau at redhat.com
Tue Dec 1 04:11:52 PST 2015
On Mon, Nov 30, 2015 at 02:31:43PM -0500, Frediano Ziglio wrote:
> > + g_setenv("G_MESSAGES_DEBUG", "all", FALSE);
>
> Do not set environment in a library.
> This affects any usage of g_xxxx logging macros in the process (and
> possibly sub processes).
Yes, but I don't think there's a function in glib to configure this...
Note that this is only done when SPICE_DEBUG_LEVEL is used (which I
consider legacy after this commit). I can change this to "Spice" rather
than "all" so that it only affects spice-server logs, but
SPICE_DEBUG_LEVEL=xx G_MESSAGES_DEBUG=all is not going to work after
that, so probably better to change log level for all when using the
legacy method.
> I tried to see the interaction with Qemu and is quite hard to
> understand where the logging are going (mostly in Qemu is quite
> messy, there are logging to file, stderr, printfs, g_xxxx functions...
> quite messy). Staying to spice-common these changes put some logs
> to stdout and others to stderr. I don't know what will happen
> to solutions like Qemu, libvirt and so on. Are they collecting
> stdout and stderr all into a single file? This would make this change
> much less worrying me.
Qemu outputs to stdout/stderr, I don't think it writes to a file by
default. libvirt collects everything to a single file as far as I can
tell.
> Would like also to have some automated tests.
What kind of testing? That the expected logs are output depending on how
the environment variables are setup? Something else?
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/20151201/7e880f48/attachment.sig>
More information about the Spice-devel
mailing list