diff options
Diffstat (limited to 'src/logging.py')
-rw-r--r-- | src/logging.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/logging.py b/src/logging.py index d2b7e61a..f94ac466 100644 --- a/src/logging.py +++ b/src/logging.py @@ -71,10 +71,14 @@ class Logger(object): fd = open(dir+room, 'a') except IOError: return + try: + msg = msg.encode('utf-8') + except: + pass if nick: - fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+nick.encode('utf-8')+': '+msg.encode('utf-8')+'\n') + fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+nick.encode('utf-8')+': '+msg+'\n') else: - fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+'* '+msg.encode('utf-8')+'\n') + fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+'* '+msg+'\n') fd.close() logger = Logger() |