diff options
Diffstat (limited to 'src/logging.py')
-rw-r--r-- | src/logging.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/logging.py b/src/logging.py index aa466348..42a82760 100644 --- a/src/logging.py +++ b/src/logging.py @@ -68,7 +68,10 @@ class Logger(object): makedirs(dir) except:pass fd = open(dir+room, 'a') - fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+nick+': '+msg+'\n') + if nick: + fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+nick.encode('utf-8')+': '+msg.encode('utf-8')+'\n') + else: + fd.write(datetime.now().strftime('%d-%m-%y [%H:%M:%S] ')+'* '+msg.encode('utf-8')+'\n') fd.close() logger = Logger() |