]> xenbits.xensource.com Git - libvirt.git/commitdiff
* src/libvirt.c: convert entry points to new logging
authorDaniel Veillard <veillard@redhat.com>
Mon, 22 Dec 2008 10:46:01 +0000 (10:46 +0000)
committerDaniel Veillard <veillard@redhat.com>
Mon, 22 Dec 2008 10:46:01 +0000 (10:46 +0000)
daniel

ChangeLog
src/libvirt.c

index c3dfcda43a9d1b0234b1484412d4e3d46916ad8b..55ecb2a42eab6f38221802f39e2974a1181c8ace 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 7efe1d01f9439c422f8bbf05de2e22c4ae817144..8922f08d507c2c4f7a25a996e6d027d01536483c 100644 (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");