mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
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
This commit is contained in:
parent
fa3c558596
commit
c59b9e1483
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user