mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-12 12:55:46 +00:00
virsh: Make "DEBUG" loglevel the superset
Aligning loglevel values of virsh to that of libvirt. "DEBUG"=0 loglevel, when specified through commandline or env variable, should log all the messages. "ERROR=4" should log only error messages. Signed-off-by: Supriya Kannery <supriyak@in.ibm.com>
This commit is contained in:
parent
2de8aa8fd0
commit
c1710ca6a0
@ -13331,13 +13331,17 @@ vshDebug(vshControl *ctl, int level, const char *format, ...)
|
|||||||
va_list ap;
|
va_list ap;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
va_start(ap, format);
|
/* Aligning log levels to that of libvirt.
|
||||||
vshOutputLogFile(ctl, VSH_ERR_DEBUG, format, ap);
|
* Traces with levels >= user-specified-level
|
||||||
va_end(ap);
|
* gets logged into file
|
||||||
|
*/
|
||||||
if (level > ctl->debug)
|
if (level < ctl->debug)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
va_start(ap, format);
|
||||||
|
vshOutputLogFile(ctl, level, format, ap);
|
||||||
|
va_end(ap);
|
||||||
|
|
||||||
va_start(ap, format);
|
va_start(ap, format);
|
||||||
if (virVasprintf(&str, format, ap) < 0) {
|
if (virVasprintf(&str, format, ap) < 0) {
|
||||||
/* Skip debug messages on low memory */
|
/* Skip debug messages on low memory */
|
||||||
|
Loading…
Reference in New Issue
Block a user