File obs-server-2.10-0004-api-Log-server-name-to-test-log-for-backend-log-mess.patch of Package obs-server

From daff768cb5f4de7cb5b673433158942df8a1a0f2 Mon Sep 17 00:00:00 2001
From: Oleg Girko <ol@infoserver.lv>
Date: Thu, 26 Feb 2015 21:11:43 +0000
Subject: [PATCH] [api] Log server name to test log for backend log messages.

Test log produced by testsuite contains messages from frontend and backend.
Sometimes it's not obvious which backend server produced some message.
This change makes log messages produced by backend during tests
to be prefixed by the name of the server which produced the message.
Also, a message is logged when backend server has stopped running.

Signed-off-by: Oleg Girko <ol@infoserver.lv>
---
 src/api/script/start_test_backend | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/api/script/start_test_backend b/src/api/script/start_test_backend
index 00a628ec52..1a9079f4d6 100755
--- a/src/api/script/start_test_backend
+++ b/src/api/script/start_test_backend
@@ -106,11 +106,12 @@ srcsrv = Thread.new do
     begin
       line = srcsrv_out.gets
       break if line.nil?
-      logger.debug line.strip unless line.empty?
+      logger.debug 'bs_srcserver: ' + line.strip unless line.empty?
     rescue IOError
       break
     end
   end
+  logger.debug 'bs_srcserver stopped'
 end
 
 puts 'Starting backend repserver...'
@@ -121,11 +122,12 @@ reposrv = Thread.new do
     begin
       line = reposrv_out.gets
       break if line.nil?
-      logger.debug line.strip unless line.empty?
+      logger.debug 'bs_repserver: ' + line.strip unless line.empty?
     rescue IOError
       break
     end
   end
+  logger.debug 'bs_repserver stopped'
 end
 
 until dienow
@@ -161,11 +163,12 @@ servicesrv = Thread.new do
     begin
       line = servicesrv_out.gets
       break if line.nil?
-      logger.debug line.strip unless line.empty?
+      logger.debug 'bs_service: ' + line.strip unless line.empty?
     rescue IOError
       break
     end
   end
+  logger.debug 'bs_service stopped'
 end
 
 puts 'Starting backend service dispatcher...'
@@ -190,10 +193,11 @@ while publishsrv_out && !dienow
   begin
     line = publishsrv_out.gets
     break if line.nil?
-    logger.debug line.strip unless line.empty?
+    logger.debug 'bs_publish: ' + line.strip unless line.empty?
   rescue IOError
     break
   end
+  logger.debug 'bs_publish stopped'
 end
 
 until dienow
-- 
2.31.1