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

From 3467a8ccea5ed8013b335ab27dc46d40d4bd8cbf 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 ac64d32320..f5821b2e72 100755
--- a/src/api/script/start_test_backend
+++ b/src/api/script/start_test_backend
@@ -125,11 +125,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...'
@@ -140,11 +141,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
@@ -180,11 +182,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...'
@@ -209,10 +212,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.20.1