summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-04-06 11:45:34 +0200
committermathieui <mathieui@mathieui.net>2013-04-06 11:45:34 +0200
commite5f219d43edbb4b05c8890f81f2f93b90e215a10 (patch)
tree6b91bef17cb9cd9c9c67c748c6b17177d9c936a0
parent91b960b797bbf17f6c4b33279f2d406c5a2c93b2 (diff)
downloadpoezio-e5f219d43edbb4b05c8890f81f2f93b90e215a10.tar.gz
poezio-e5f219d43edbb4b05c8890f81f2f93b90e215a10.tar.bz2
poezio-e5f219d43edbb4b05c8890f81f2f93b90e215a10.tar.xz
poezio-e5f219d43edbb4b05c8890f81f2f93b90e215a10.zip
Do not attempt to log things when use_log = false
-rw-r--r--src/logger.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/logger.py b/src/logger.py
index a696137f..7df44a29 100644
--- a/src/logger.py
+++ b/src/logger.py
@@ -104,6 +104,8 @@ class Logger(object):
"""
log the message in the appropriate jid's file
"""
+ if config.get_by_tabname('use_log', 'false', jid) != 'true':
+ return True
if jid in self.fds.keys():
fd = self.fds[jid]
else:
@@ -130,6 +132,11 @@ class Logger(object):
return True
def log_roster_change(self, jid, message):
+ """
+ Log a roster change
+ """
+ if config.get_by_tabname('use_log', 'false', jid) != 'true':
+ return True
if not self.roster_logfile:
try:
self.roster_logfile = open(os.path.join(DATA_HOME, 'logs', 'roster.log'), 'a')