Re: [PATCH 2/7 v2] Refactor code that skips logging of error messages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/10/2014 09:01 AM, Daniel P. Berrange wrote:
> The error reporting code will invoke a callback when any error
> is raised and the default callback will print to stderr. The
> virRaiseErrorFull method also sends all error messages on to the
> logging code, which also prints to stderr by default. To avoid
> duplicated data on stderr, the logging code has some logic to
> skip emission when no log outputs are configured, which checks
> whether the virLogSource == VIR_LOG_FROM_ERROR.
> 
> Meanwhile the libvirtd daemon can register another callback which
> is used to reduce log message priority from error to a lower level.
> When this is used we do want messages to end up on stderr, so the
> error code will conditionally use either VIR_LOG_FROM_FILE or
> VIR_LOG_FROM_ERROR depending on whether such a callback is provided.
> 
> This will all complicate later refactoring. By pushing the checks
> for whether a log output is present up a level into the error code,
> the special cases can be isolated in one place.
> 
> Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> ---
>  src/util/virerror.c | 17 +++++++++++++----
>  src/util/virlog.c   |  2 +-
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 

ACK

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]