* src/libvirt.c: convert entry points to new logging

daniel
This commit is contained in:
Daniel Veillard 2008-12-22 10:46:01 +00:00
parent 698d80a824
commit f99b202f5b
2 changed files with 20 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Mon Dec 22 11:45:07 CET 2008 Daniel Veillard <veillard@redhat.com>
* src/libvirt.c: convert entry points to new logging
Mon Dec 22 11:43:04 CET 2008 Daniel Veillard <veillard@redhat.com>
* src/logging.h src/logging.c: commited the more recent version

View File

@ -257,8 +257,22 @@ virInitialize(void)
#ifdef ENABLE_DEBUG
debugEnv = getenv("LIBVIRT_DEBUG");
if (debugEnv && *debugEnv && *debugEnv != '0')
debugFlag = 1;
if (debugEnv && *debugEnv && *debugEnv != '0') {
if (STREQ(debugEnv, "2") || STREQ(debugEnv, "info"))
virLogSetDefaultPriority(VIR_LOG_INFO);
else if (STREQ(debugEnv, "3") || STREQ(debugEnv, "warning"))
virLogSetDefaultPriority(VIR_LOG_WARN);
else if (STREQ(debugEnv, "4") || STREQ(debugEnv, "error"))
virLogSetDefaultPriority(VIR_LOG_ERROR);
else
virLogSetDefaultPriority(VIR_LOG_DEBUG);
}
debugEnv = getenv("LIBVIRT_LOG_FILTERS");
if (debugEnv)
virLogParseFilters(debugEnv);
debugEnv = getenv("LIBVIRT_LOG_OUTPUTS");
if (debugEnv)
virLogParseOutputs(debugEnv);
#endif
DEBUG0("register drivers");