diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-06-07 11:53:40 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-07-21 11:15:24 +0200 |
commit | 77a9a62556a35fbb43209d537b894e652abab2d6 (patch) | |
tree | 94356110667fc1e362e579dca2c490d30ab49d21 /client | |
parent | 51628f512456cd26c8c6b417be6b34f3889b33d2 (diff) | |
download | spice-77a9a62556a35fbb43209d537b894e652abab2d6.tar.gz spice-77a9a62556a35fbb43209d537b894e652abab2d6.tar.xz spice-77a9a62556a35fbb43209d537b894e652abab2d6.zip |
spicec: Make loglevel configurable through the environment
Having a loglevel variable is much more useful if we can actually change
its value without a recompile. Use a SPICEC_LOG_LEVEL environment variable so
we can do this from the spice xpi / activex too (by setting the environment
variable before starting the browser).
Diffstat (limited to 'client')
-rw-r--r-- | client/application.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client/application.cpp b/client/application.cpp index 5ebcce7f..bf0af025 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -50,6 +50,7 @@ #endif #include <stdarg.h> #include <stdio.h> +#include <stdlib.h> #include <time.h> #ifdef USE_SMARTCARD @@ -2607,6 +2608,12 @@ int Application::main(int argc, char** argv, const char* version_str) { int ret; bool full_screen; + char *log_level_str; + + log_level_str = getenv("SPICEC_LOG_LEVEL"); + if (log_level_str) { + log_level = atoi(log_level_str); + } init_globals(); LOG_INFO("starting %s", version_str); |