[vlma-devel] commit: Keep displaying logs on stdout (if desired). (Adrien Grand )

git version control git at videolan.org
Wed Apr 1 21:25:46 CEST 2009


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Wed Apr  1 20:46:01 2009 +0200| [ddfe1978511e07102f04f35d6c757c32e0825953] | committer: Adrien Grand 

Keep displaying logs on stdout (if desired).

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=ddfe1978511e07102f04f35d6c757c32e0825953
---

 vlma-watchdog/src/conf.py |    5 +++++
 vlma-watchdog/src/vlc.py  |    3 +++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/vlma-watchdog/src/conf.py b/vlma-watchdog/src/conf.py
index 0d41811..061a5f0 100644
--- a/vlma-watchdog/src/conf.py
+++ b/vlma-watchdog/src/conf.py
@@ -19,6 +19,7 @@ CPU_LOAD_THRESHOLD = 6.0
 VLC_CPU_THRESHOLD  = 80.0
 VLC_MEMORY_THRESHOLD = 80.0
 
+# Not taken into account on Windows
 NETWORK_INTERFACE = "eth0"
 
 # HTTP interface exposed by this script
@@ -29,3 +30,7 @@ SERVER_PASSWORD = "admin"
 # Size of the log queue to keep in memory
 LOG_TAIL_SIZE = 500
 
+import sys
+# Where to write VLC logs (can be empty)
+DISPLAY_LOGS_TO = [ sys.stdout ]
+
diff --git a/vlma-watchdog/src/vlc.py b/vlma-watchdog/src/vlc.py
index 490ae01..13fa60e 100755
--- a/vlma-watchdog/src/vlc.py
+++ b/vlma-watchdog/src/vlc.py
@@ -158,6 +158,9 @@ class LogReader(threading.Thread):
         continue
       self.__output_lock.acquire()
       self.__output.append(line)
+      for file in conf.DISPLAY_LOGS_TO:
+        file.write(line)
+        file.write('\n')
       to_remove = len(self.__output) - self.__size
       if to_remove > 0:
         for i in range(to_remove):



More information about the vlma-devel mailing list