virlog: Split parsing and setting priority

Handling of outputs and filters has been changed in a way that splits
parsing and defining. Do the same thing for logging priority as well, this
however, doesn't need much of a preparation.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
Erik Skultety
2016-03-21 14:35:37 +01:00
parent adda3e4f9b
commit 6fe47467cb
2 changed files with 23 additions and 21 deletions

View File

@@ -311,7 +311,8 @@ mymain(void)
if (virThreadInitialize() < 0)
return EXIT_FAILURE;
char *debugEnv = getenv("LIBVIRT_DEBUG");
if (debugEnv && *debugEnv && (virLogParseDefaultPriority(debugEnv) == -1)) {
if (debugEnv && *debugEnv &&
(virLogSetDefaultPriority(virLogParseDefaultPriority(debugEnv)) < 0)) {
fprintf(stderr, "Invalid log level setting.\n");
return EXIT_FAILURE;
}