Reorder code for setting default log level from cmdline prior
initialization of log outputs. Thus the --verbose option is reflected.
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1325072
---
src/logging/log_daemon.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/logging/log_daemon.c b/src/logging/log_daemon.c
index 8f1ccc2..9f71ca9 100644
--- a/src/logging/log_daemon.c
+++ b/src/logging/log_daemon.c
@@ -405,6 +405,12 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
virLogParseOutputs(config->log_outputs);
/*
+ * Command line override for --verbose
+ */
+ if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
+ virLogSetDefaultPriority(VIR_LOG_INFO);
+
+ /*
* If no defined outputs, and either running
* as daemon or not on a tty, then first try
* to direct it to the systemd journal
@@ -464,12 +470,6 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
VIR_FREE(tmp);
}
- /*
- * Command line override for --verbose
- */
- if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
- virLogSetDefaultPriority(VIR_LOG_INFO);
-
return 0;
error:
The same pattern is present in lock_daemon.c too. Libvirtd seems to
already use the pattern you're adding.
Regards,
Daniel
--
|: