[Spice-devel] [spice-common 1/3] log: Clamp SPICE_DEBUG_LEVEL if it's too high

Pavel Grunt pgrunt at redhat.com
Tue Apr 5 11:28:14 UTC 2016


Hi,

ack for the series.

Pavel

On Tue, 2016-04-05 at 12:56 +0200, Christophe Fergeau wrote:
> This matches how SPICE_DEBUG_LEVEL behaved before switching to glib
> logging.
> ---
>  common/log.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/common/log.c b/common/log.c
> index 8d47cb6..5f08470 100644
> --- a/common/log.c
> +++ b/common/log.c
> @@ -67,6 +67,9 @@ static void spice_log_set_debug_level(void)
>              /* FIXME: To be removed after enough deprecation time */
>              g_warning("Setting SPICE_DEBUG_LEVEL is deprecated, use
> G_MESSAGES_DEBUG instead");
>              debug_level = atoi(debug_str);
> +            if (debug_level > SPICE_LOG_LEVEL_DEBUG) {
> +                debug_level = SPICE_LOG_LEVEL_DEBUG;
> +            }
>              glib_debug_level = spice_log_level_to_glib(debug_level);
>  
>              /* If the debug level is too high, make sure we don't
> try to enable


More information about the Spice-devel mailing list