From 4abf26e2ea5a54afbfeb47e2a7b92dd98fed82dc Mon Sep 17 00:00:00 2001
From: Jorrit Schaap <schaap@astron.nl>
Date: Thu, 24 Oct 2019 12:31:26 +0200
Subject: [PATCH] SW-833: testing and logging

---
 MAC/TBB/lib/tbb_restart_recording.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/MAC/TBB/lib/tbb_restart_recording.py b/MAC/TBB/lib/tbb_restart_recording.py
index b794b7ef094..1e56e958c73 100755
--- a/MAC/TBB/lib/tbb_restart_recording.py
+++ b/MAC/TBB/lib/tbb_restart_recording.py
@@ -16,11 +16,11 @@ from lofar.common.lcu_utils import translate_user_station_string_into_station_li
 
 
 def restart_tbb_recording(stations):
-    logging.info("Restarting TBB recording")
-
     stations = translate_user_station_string_into_station_list(stations)
     station_hostname_csv_string = ','.join(stationname2hostname(s) for s in stations)
 
+    logging.info("Restarting TBB recording on stations %s", stations)
+
     relay = lcurun_command + [station_hostname_csv_string]
     cmd = relay + [tbb_command, "--record"]
     logging.info("Executing %s" % " ".join(cmd))
@@ -35,3 +35,7 @@ def parse_args():
 def main():
     args = parse_args()
     restart_tbb_recording(args.stations)
+
+if __name__ == '__main__':
+    logging.basicConfig(format='%(asctime)s %(levelname)s %(message)s', level=logging.INFO)
+    main()
\ No newline at end of file
-- 
GitLab