提交 c1710ca6 编写于 作者: S Supriya Kannery 提交者: Eric Blake

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: NSupriya Kannery <supriyak@in.ibm.com>
上级 2de8aa8f
...@@ -13331,13 +13331,17 @@ vshDebug(vshControl *ctl, int level, const char *format, ...) ...@@ -13331,13 +13331,17 @@ vshDebug(vshControl *ctl, int level, const char *format, ...)
va_list ap; va_list ap;
char *str; char *str;
/* Aligning log levels to that of libvirt.
* Traces with levels >= user-specified-level
* gets logged into file
*/
if (level < ctl->debug)
return;
va_start(ap, format); va_start(ap, format);
vshOutputLogFile(ctl, VSH_ERR_DEBUG, format, ap); vshOutputLogFile(ctl, level, format, ap);
va_end(ap); va_end(ap);
if (level > ctl->debug)
return;
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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册