提交 c59b9e14 编写于 作者: J Jaroslav Suchanek 提交者: Erik Skultety

logging: fixing log level initialization from cmdline

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
上级 fa3c5585
......@@ -481,6 +481,12 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
if (virLogGetNbOutputs() == 0)
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
......@@ -541,12 +547,6 @@ virLockDaemonSetupLogging(virLockDaemonConfigPtr config,
VIR_FREE(tmp);
}
/*
* Command line override for --verbose
*/
if ((verbose) && (virLogGetDefaultPriority() > VIR_LOG_INFO))
virLogSetDefaultPriority(VIR_LOG_INFO);
return 0;
error:
......
......@@ -404,6 +404,12 @@ virLogDaemonSetupLogging(virLogDaemonConfigPtr config,
if (virLogGetNbOutputs() == 0)
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
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册