From c8ea77e99a209ec7ae24eb3a9232fcad3aede53c Mon Sep 17 00:00:00 2001 From: pablo Date: Thu, 26 Mar 2020 11:47:12 +0100 Subject: [PATCH] Logging en explorer.py --- explorer/explorer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/explorer/explorer.py b/explorer/explorer.py index 374b5fe..3cad2c2 100644 --- a/explorer/explorer.py +++ b/explorer/explorer.py @@ -36,12 +36,13 @@ class Explorer: self.queue_retries = 0 def start(self): - + logging.info("Starting explorer") while True: if not self.there_is_work(): print("{}: Waiting. No work".format(datetime.datetime.now())) sleep(Explorer.sleep_time_no_work) continue + logging.info("Waiting") if not self.database_is_up(): alert_master( @@ -52,7 +53,7 @@ class Explorer: current_task = ExploringTask(self.compose_listing_url()) current_task.explore() - print("{}: Exploring done".format(datetime.datetime.now())) + logging.info("Exploring task done...") if current_task.status == "Referencias ready": referencias = current_task.get_referencias() @@ -61,6 +62,7 @@ class Explorer: referencia, current_task.id ) current_task._update_status("Sent to queue") + logging.info("The task was successful.") continue