semi-fixed logging

This commit is contained in:
Luke Rogers 2013-10-06 15:23:06 +13:00
parent 43d4d282f7
commit 99c227ffc7

View file

@ -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)