mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-29 20:11:16 +00:00
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>
This commit is contained in:
parent
25420111ba
commit
f8625248ac
@ -775,9 +775,11 @@ void virRaiseErrorLog(const char *filename,
|
|||||||
* hate & thus disable that too. If the daemon has set
|
* hate & thus disable that too. If the daemon has set
|
||||||
* a priority filter though, we should always forward
|
* a priority filter though, we should always forward
|
||||||
* all errors to the logging code.
|
* all errors to the logging code.
|
||||||
|
* Similarly when debug priority is the default we want to log the error.
|
||||||
*/
|
*/
|
||||||
if (virLogGetNbOutputs() > 0 ||
|
if (virLogGetNbOutputs() > 0 ||
|
||||||
virErrorLogPriorityFilter)
|
virErrorLogPriorityFilter ||
|
||||||
|
virLogGetDefaultPriority() == VIR_LOG_DEBUG)
|
||||||
virLogMessage(&virLogSelf,
|
virLogMessage(&virLogSelf,
|
||||||
priority,
|
priority,
|
||||||
filename, linenr, funcname,
|
filename, linenr, funcname,
|
||||||
|
Loading…
Reference in New Issue
Block a user