summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 02:19:01 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-13 02:19:01 +0000
commitff33a84de722c62af1268421133c7376eb35c4f6 (patch)
tree821b8a7b39d3b34be1398be99613a0538c6a5c18
parent94d9d02e8f7049cff2befbed853a1cc8075a99d5 (diff)
downloadpoezio-ff33a84de722c62af1268421133c7376eb35c4f6.tar.gz
poezio-ff33a84de722c62af1268421133c7376eb35c4f6.tar.bz2
poezio-ff33a84de722c62af1268421133c7376eb35c4f6.tar.xz
poezio-ff33a84de722c62af1268421133c7376eb35c4f6.zip
logs work. fixed #1108
-rw-r--r--data/default_config.cfg6
-rw-r--r--src/logging.py5
-rw-r--r--src/room.py2
3 files changed, 9 insertions, 4 deletions
diff --git a/data/default_config.cfg b/data/default_config.cfg
index cbae24c3..d4dfe5bc 100644
--- a/data/default_config.cfg
+++ b/data/default_config.cfg
@@ -73,6 +73,9 @@ hide_exit_join = -1
hide_status_change = 120
+# set to 'true' if you want to save logs of all the messages
+# in files. They will be saved in ~/.config/poezio/logs
+use_log = false
# the full path to the photo (avatar) you want to use
# it should be less than 16Ko
@@ -92,9 +95,6 @@ send_os_info = true
# Set to false if you don't want people to know that information
send_time = true
-# the file where logs are saved (useless for the moment)
-logfile = logs
-
# Vcard
# here are personal informations that you can set in your Vcard
# Obviously, everything is optionnal.
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()
diff --git a/src/room.py b/src/room.py
index 8cd7a0f8..28f8cfad 100644
--- a/src/room.py
+++ b/src/room.py
@@ -64,6 +64,8 @@ class Room(object):
when we receive an history message said by someone who is not
in the room anymore
"""
+ if time == None and self.joined: # don't log the history messages
+ logger.message(self.name, nickname, txt)
user = self.get_user_by_name(nickname) if nickname is not None else None
if user:
user.set_last_talked(datetime.now())