From 0a34833d3dc92406f2c404b26d619d7ff45eff18 Mon Sep 17 00:00:00 2001 From: mickael Date: Sun, 6 Jan 2019 05:13:23 +0000 Subject: [PATCH] "prettier" thread exit message --- proxywatchd.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxywatchd.py b/proxywatchd.py index 75b2e5f..1cf6cc2 100644 --- a/proxywatchd.py +++ b/proxywatchd.py @@ -3,6 +3,7 @@ import threading import time, random, string, re, copy import requests +import sys #from geoip import geolite2 import config @@ -128,12 +129,13 @@ class WorkerThread(): if self.done.is_set(): break time.sleep(0.01) if self.thread: - _log("thread terminated", self.id) + sys.stdout.write('%s/%s\tthread terminated\r' % (time.strftime('%H:%M:%S', time.gmtime()), self.id)) + sys.stdout.flush() class Proxywatchd(): def stop(self): - _log('Requesting proxywatchd to halt (%d thread(s))' % len([item for item in self.threads if True])) + _log('\rRequesting proxywatchd to halt (%d thread(s))' % len([item for item in self.threads if True])) self.stopping.set() def _cleanup(self):