]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virRaiseErrorLog: Don't skip error printing when enabling debug logging env variable
authorPeter Krempa <pkrempa@redhat.com>
Mon, 22 May 2023 12:58:38 +0000 (14:58 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 5 Jun 2023 11:20:12 +0000 (13:20 +0200)
commitf8625248ac83b3b17c054ca617d87022327b8af8
treece15642b4bdbd810ae370cbc6319b6a84a5bfa17
parent25420111ba089ecf8141f8db43d7d8262b3f91dc
virRaiseErrorLog: Don't skip error printing when enabling debug logging env variable

When a user requests debug logging by setting the environment variable:

LIBVIRT_DEBUG=1

we should log any errors regardless of the setting of e.g.
'LIBVIRT_LOG_OUTPUTS' as the code will log every 'debug' and 'info'
level message to stderr but will skip 'error' level messages.

This obviously makes debugging things very complicated as you can get to
a situation when the error itself is missing.

This can happen e.g. in tests.

Fix the issue by probing the default log level and calling the logger if
it's set for VIR_LOG_DEBUG.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/util/virerror.c