Improve logging

This commit is contained in:
Gokberk Yaltirakli 2019-05-04 13:27:42 +01:00
parent 5cb7d9a3a7
commit 8bab4eca1b
1 changed files with 5 additions and 3 deletions

View File

@ -108,7 +108,8 @@ def main():
try:
logging.debug("Creating socket nr %s", _)
s = init_socket(ip)
except socket.error:
except socket.error as e:
logging.debug(e)
break
list_of_sockets.append(s)
@ -127,13 +128,14 @@ def main():
s = init_socket(ip)
if s:
list_of_sockets.append(s)
except socket.error:
except socket.error as e:
logging.debug(e)
break
logging.debug("Sleeping for %d seconds", args.sleeptime)
time.sleep(args.sleeptime)
except (KeyboardInterrupt, SystemExit):
print("\nStopping Slowloris...")
logging.info("Stopping Slowloris")
break
if __name__ == "__main__":