nicer output
This commit is contained in:
parent
6f3a10527e
commit
c2271b1195
2 changed files with 2 additions and 2 deletions
|
@ -31,7 +31,7 @@ def get_logger():
|
||||||
# create a formatter and set the formatter for the handler.
|
# create a formatter and set the formatter for the handler.
|
||||||
frmt = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s')
|
frmt = logging.Formatter('%(asctime)s [%(levelname)s] %(message)s')
|
||||||
fh.setFormatter(frmt)
|
fh.setFormatter(frmt)
|
||||||
simple_frmt = logging.Formatter('[%(levelname)s] %(message)s')
|
simple_frmt = logging.Formatter('%(message)s')
|
||||||
sh.setFormatter(simple_frmt)
|
sh.setFormatter(simple_frmt)
|
||||||
|
|
||||||
# add the Handlers to the logger
|
# add the Handlers to the logger
|
||||||
|
|
|
@ -104,7 +104,7 @@ class SendThread(threading.Thread):
|
||||||
def run(self):
|
def run(self):
|
||||||
while not self.shutdown:
|
while not self.shutdown:
|
||||||
line = self.output_queue.get().splitlines()[0][:500]
|
line = self.output_queue.get().splitlines()[0][:500]
|
||||||
print u"{}>>> {}".format(self.conn_name, line)
|
print u"{}> {}".format(self.conn_name, line)
|
||||||
self.output_buffer += line.encode('utf-8', 'replace') + '\r\n'
|
self.output_buffer += line.encode('utf-8', 'replace') + '\r\n'
|
||||||
while self.output_buffer:
|
while self.output_buffer:
|
||||||
sent = self.socket.send(self.output_buffer)
|
sent = self.socket.send(self.output_buffer)
|
||||||
|
|
Reference in a new issue