except (LATClientException, socket.error), e:
(exc_type, exc_value, exc_traceback) = sys.exc_info()
del exc_traceback
- print
- print "Connection error: "+str(exc_type)+" "+str(e)
- print "Trying again in 5 seconds."
+ logging.error("Connection error: "+str(exc_type)+" "+str(e))
+ logging.info("Trying again in 5 seconds.")
sleep(5)
continue
+
try:
run_forever(rfh, wfh, options, config_opts)
except VendingException:
- print
- print "Connection died, trying again..."
+ logging.error("Connection died, trying again...")
+ logging.info("Trying again in 5 seconds.")
+ sleep(5)
if __name__ == '__main__':
options, config_opts = set_stuff_up()