[libvirt] PATCH: Always log source location if available.
Daniel Veillard
veillard at redhat.com
Thu May 28 11:58:56 UTC 2009
On Wed, May 27, 2009 at 01:15:40PM +0100, Daniel P. Berrange wrote:
>
> Currently, even though all the logging functions get given the source
> function and line number, it is just discarded unless priority == DEBUG.
>
> As an example, run virsh with logging enabled, and a bogus URI
>
> LIBVIRT_DEBUG=1 LIBVIRT_LOG_OUTPUTS=1:stderr virsh -c foo://bar
> 13:12:06.252: debug : do_open:993 : trying driver 4 (remote) ...
> 13:12:06.252: debug : do_open:999 : driver 4 remote returned DECLINED
> 13:12:06.252: error : could not connect to foo://bar
> 13:12:06.252: debug : virUnrefConnect:232 : unref connection 0x99617b0 1
> 13:12:06.252: debug : virReleaseConnect:191 : release connection 0x99617b0
>
>
>
> Notice how it doesn't tell the user where the log message with 'error'
> priority came from. The same happens for info & warn levels.
>
> With the following patch applied, we always report function if it was
> passed into virLogMessage()
>
> 13:15:00.456: debug : do_open:993 : trying driver 4 (remote) ...
> 13:15:00.456: debug : do_open:999 : driver 4 remote returned DECLINED
> 13:15:00.456: error : virLibConnError:390 : could not connect to foo://bar
> 13:15:00.456: debug : virUnrefConnect:232 : unref connection 0x8dd87b0 1
> 13:15:00.456: debug : virReleaseConnect:191 : release connection 0x8dd87b0
>
>
> So, we now see that the error came from virLibConnError at line 390
Okay, fine, it's just that this is more debugging informations than
anything else, which is why I though it was fine to limit this to debug
sessions. ACK,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
More information about the libvir-list
mailing list