diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-04-05 12:46:05 +0200 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-04-05 15:38:16 +0200 |
commit | 6a65f470d1fc12f2d2cfb81b940faca9ff91d56c (patch) | |
tree | 31915beec28e1bd3c7dc533b45c396d6a7a70fd5 | |
parent | 6c7552d54369ced08a9b2c61587cad44c04d4ab9 (diff) |
log: Clamp SPICE_DEBUG_LEVEL if it's too high
This matches how SPICE_DEBUG_LEVEL behaved before switching to glib
logging.
-rw-r--r-- | common/log.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 |