[virt-tools-list] [PATCH virt-viewer] spice-xpi-client: log to SPICE_XPI_CLIENT_LOG if specified

Daniel P. Berrange berrange at redhat.com
Tue Apr 17 15:00:58 UTC 2012


On Tue, Apr 17, 2012 at 04:57:32PM +0200, Marc-André Lureau wrote:
> Logging to syslog is pretty nice, but doesn't let the user easily read
> it back without special rights. Instead, rely on default desktop logging
> (sadly to ~/.xsession-errors, atm), and allows to redefine logging to a
> file specified by SPICE_XPI_CLIENT_LOG. People who prefer keeping the
> old spicec ~/.spicec/spicec.log file can set this variable in their
> enviroment.

I assume we'll soon have systemd running the desktop session
at which point we'll get the nice journald logging facilities

> ---
>  data/spice-xpi-client-remote-viewer |   13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/data/spice-xpi-client-remote-viewer b/data/spice-xpi-client-remote-viewer
> index 3109c66..03e72d0 100644
> --- a/data/spice-xpi-client-remote-viewer
> +++ b/data/spice-xpi-client-remote-viewer
> @@ -1,6 +1,11 @@
>  #!/bin/sh
>  
> -logger -t spice "starting remote-viewer --spice-controller $@..."
> -env | logger -t spice
> -exec remote-viewer --spice-controller "$@" 2>&1 | logger -t spice
> -logger -t spice "remote-viewer execution failed"
> +if [ x"$SPICE_XPI_CLIENT_LOG" != x ] ; then
> +    exec 2>&1
> +    exec >> "$SPICE_XPI_CLIENT_LOG"
> +fi
> +
> +echo "starting remote-viewer --spice-controller $@..."
> +env | grep -i spice
> +exec remote-viewer --spice-controller "$@"
> +echo "remote-viewer execution failed"

ACK


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the virt-tools-list mailing list