do more logging
[zanchey/dispense2.git] / sql-edition / servers / VendServer.py
index 6e870ff..4d9aae2 100755 (executable)
@@ -505,16 +505,17 @@ def do_vend_server(options, config_opts):
                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()

UCC git Repository :: git.ucc.asn.au