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

Frediano Ziglio fziglio at redhat.com
Fri Jun 16 16:37:09 UTC 2017


> 
> 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?

Frediano


More information about the Spice-devel mailing list