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

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



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.
---
 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"
-- 
1.7.10


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