[Spice-devel] Role of spice_logger
Christophe Fergeau
cfergeau at redhat.com
Wed May 31 07:54:51 UTC 2017
On Tue, May 30, 2017 at 11:12:11AM -0400, Frediano Ziglio wrote:
> >
> > I’m looking at logging functions in log.c, and I wonder why we disable
> > logging only at the spice_logger level.
> >
> > There is a test like this in spice_logger:
> >
> > if (glib_debug_level != 0) {
> > if ((log_level & G_LOG_LEVEL_MASK) > glib_debug_level)
> > return; // do not print anything
> > }
> >
> > Shouldn’t put the test in spice_log, so that we don’t do all the formatting
> > and allocation if we don’t need it?
> >
> >
> > Christophe
>
> Yes, make sense
We want g_log as well as spice_log to take into account the
SPICE_DEBUG_LEVEL environment variable (for backward compat).
If you move the test above to spice_log, I suspect g_warning & friends
will stop honouring SPICE_DEBUG_LEVEL. spice-common/tests/test-logging.c
might have a test for that if you want to experiment..
Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170531/6e88b8f7/attachment.sig>
More information about the Spice-devel
mailing list