From 99c227ffc7eab3eb6760c14b975ef7c267ed2314 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Sun, 6 Oct 2013 15:23:06 +1300 Subject: [PATCH] semi-fixed logging --- plugins/log.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/log.py b/plugins/log.py index 487d92f..eafed3e 100755 --- a/plugins/log.py +++ b/plugins/log.py @@ -3,6 +3,7 @@ log.py: written by Scaevolus 2009 """ import os +import sys import codecs import time import re @@ -88,7 +89,7 @@ def get_log_fd(dir, server, chan): return fd -@hook.singlethread +#@hook.singlethread @hook.event('*') def log(paraml, input=None, bot=None): timestamp = gmtime(timestamp_format) @@ -110,4 +111,6 @@ def log(paraml, input=None, bot=None): fd = get_log_fd(bot.data_dir, input.server, input.chan) fd.write(timestamp + ' ' + beau + '\n') - print timestamp, input.chan, beau.encode('utf8', 'ignore') + out = "{} {} {}".format(timestamp, input.chan, beau.encode('utf8', 'ignore')) + + sys.stdout.write(out + os.linesep)