From ce516b0bdf036761daa9a248df1194182eb2428d Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Tue, 7 Jun 2011 11:53:40 +0200 Subject: 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). --- client/application.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/application.cpp b/client/application.cpp index f19bd582..9b787c18 100644 --- a/client/application.cpp +++ b/client/application.cpp @@ -45,6 +45,7 @@ #endif #include #include +#include #include #ifdef USE_SMARTCARD @@ -2597,6 +2598,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); -- cgit