diff options
author | mathieui <mathieui@mathieui.net> | 2013-06-09 12:56:51 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2013-06-09 12:56:51 +0200 |
commit | 9d5fddf5bad0e94f3945488e4174b7a8ade58f57 (patch) | |
tree | a4777dbb8fe679c094cf1e830a9e6448abe4593a /src/logger.py | |
parent | 71b6404b04f64a8973ef0b9f8bba4c7aca3106a1 (diff) | |
download | poezio-9d5fddf5bad0e94f3945488e4174b7a8ade58f57.tar.gz poezio-9d5fddf5bad0e94f3945488e4174b7a8ade58f57.tar.bz2 poezio-9d5fddf5bad0e94f3945488e4174b7a8ade58f57.tar.xz poezio-9d5fddf5bad0e94f3945488e4174b7a8ade58f57.zip |
Use the new format in the roster log too (ref #2311)
(and add the pep events and invites to it)
Diffstat (limited to 'src/logger.py')
-rw-r--r-- | src/logger.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/logger.py b/src/logger.py index b26393da..635f0985 100644 --- a/src/logger.py +++ b/src/logger.py @@ -156,7 +156,10 @@ class Logger(object): except IOError: return False try: - self.roster_logfile.write('%s %s %s\n' % (datetime.now().strftime('%d-%m-%y [%H:%M:%S]'), jid, message)) + str_time = datetime.now().strftime('%Y%m%dT%H%M%SZ') + message = clean_text(message) + lines = str(message.count('\n')).zfill(3) + self.roster_logfile.write('MI %s %s %s %s\n' % (str_time, lines, jid, message)) self.roster_logfile.flush() except: return False |