summaryrefslogtreecommitdiff
path: root/src/logger.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-11-15 11:59:09 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-11-15 11:59:09 +0000
commitf4d4a205f136c6373c415657dd35b4f078f25c69 (patch)
tree8acda5955bd6dd93e50c9fc8926cc511b38d01a5 /src/logger.py
parentde7c007a22fc9f8b6aa9ddd94e55ec4f2b13c71d (diff)
downloadpoezio-f4d4a205f136c6373c415657dd35b4f078f25c69.tar.gz
poezio-f4d4a205f136c6373c415657dd35b4f078f25c69.tar.bz2
poezio-f4d4a205f136c6373c415657dd35b4f078f25c69.tar.xz
poezio-f4d4a205f136c6373c415657dd35b4f078f25c69.zip
a few renamings, and some other stuff
Diffstat (limited to 'src/logger.py')
-rw-r--r--src/logger.py26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/logger.py b/src/logger.py
index 4cfb7793..a1479f9c 100644
--- a/src/logger.py
+++ b/src/logger.py
@@ -29,32 +29,10 @@ class Logger(object):
"""
def __init__(self):# , logfile, loglevel):
self.logfile = config.get('logfile', 'logs')
- self.loglevel = config.get('loglevel', 3)
- # self.logfile = logfile
- # self.loglevel = loglevel
- def info(self, msg):
- if self.logfile and self.loglevel >= 3:
- fd = open(self.logfile, 'a')
- fd.write(datetime.now().strftime("%H:%M:%S") + ' Info [' + msg + ']\n')
- fd.close()
-
- def warning(self, msg):
- if self.logfile and self.loglevel >= 2:
- fd = open(self.logfile, 'a')
- fd.write(datetime.now().strftime("%H:%M:%S") + ' Warning [' + msg + ']\n')
- fd.close()
-
- def error(self, msg):
- if self.logfile and self.loglevel >= 1:
- fd = open(self.logfile, 'a')
- fd.write(datetime.now().strftime("%H:%M:%S") + ' Error [' + msg + ']\n')
- fd.close()
- sys.exit(-1)
-
- def message(self, room, nick, msg):
+ def groupchat(self, room, nick, msg):
"""
- log the message in the appropriate room
+ log the message in the appropriate room's file
"""
if config.get('use_log', 'false') == 'false':
return