[Spice-devel] [PATCH spice-server] Replace all uses of spice_printerr()

Frediano Ziglio fziglio at redhat.com
Fri Jun 16 18:29:43 UTC 2017


> 
> On Fri, 2017-06-16 at 12:37 -0400, Frediano Ziglio wrote:
> > > 
> > > For those things that are actually errors or warnings, switch to
> > > spice_warning(). For those things that are just informational,
> > > switch to
> > > spice_debug().  Currently, these messages are just indiscriminately
> > > printed to stderr even if debugging isn't enabled, which can clog
> > > up the
> > > qemu monitor, for example.
> > > 
> > > Signed-off-by: Jonathon Jongsma <jjongsma at redhat.com>
> > > ---
> > 
> > ...
> > 
> > > @@ -514,19 +514,19 @@ void
> > > main_channel_client_handle_pong(MainChannelClient
> > > *mcc, SpiceMsgPing *ping,
> > >          mcc->priv->bitrate_per_sec = (uint64_t)(NET_TEST_BYTES *
> > > 8) *
> > >          1000000
> > >              / (roundtrip - mcc->priv->latency);
> > >          mcc->priv->net_test_stage = NET_TEST_STAGE_COMPLETE;
> > > -        spice_printerr("net test: latency %f ms, bitrate %"PRIu64"
> > > bps (%f
> > > Mbps)%s",
> > > -                       (double)mcc->priv->latency / 1000,
> > > -                       mcc->priv->bitrate_per_sec,
> > > -                       (double)mcc->priv->bitrate_per_sec / 1024 /
> > > 1024,
> > > -                       main_channel_client_is_low_bandwidth(mcc) ?
> > > " LOW
> > > BANDWIDTH" : "");
> > > +        spice_debug("net test: latency %f ms, bitrate %"PRIu64"
> > > bps (%f
> > > Mbps)%s",
> > > +                    (double)mcc->priv->latency / 1000,
> > > +                    mcc->priv->bitrate_per_sec,
> > > +                    (double)mcc->priv->bitrate_per_sec / 1024 /
> > > 1024,
> > > +                    main_channel_client_is_low_bandwidth(mcc) ? "
> > > LOW BANDWIDTH" : "");
> > 
> > Personally I found this quite useful, with spice_debug is not logged
> > by
> > default. Is spice_info printed by default?
> > 
> 
> No, I don't think spice_info is printed by default.
> 
> Isn't this essentially the definition of "debugging" information,
> though? Yes, it's useful for developers, but do we want it printed to
> the terminal without debugging enabled?
> 
> Jonathon
> 

I saw these lines in many user reports. So I think they should
be an higher level.

Frediano


More information about the Spice-devel mailing list