From e8003f26e6cf3314d642d9d53584f27eacf6fac3 Mon Sep 17 00:00:00 2001 From: volaya Date: Thu, 1 Oct 2015 09:06:33 +0200 Subject: [PATCH] [processing] write log dates in ISO format fixes #13226 --- python/plugins/processing/core/ProcessingLog.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/plugins/processing/core/ProcessingLog.py b/python/plugins/processing/core/ProcessingLog.py index 55f583a01c3..88d59064d8c 100644 --- a/python/plugins/processing/core/ProcessingLog.py +++ b/python/plugins/processing/core/ProcessingLog.py @@ -40,7 +40,7 @@ class ProcessingLog: LOG_INFO = 'INFO' LOG_WARNING = 'WARNING' LOG_ALGORITHM = 'ALGORITHM' - DATE_FORMAT = u'%a %b %d %Y %H:%M:%S'.encode('utf-8') + DATE_FORMAT = "%Y-%m-%d %H:%M:%S" recentAlgs = [] @staticmethod @@ -53,7 +53,7 @@ class ProcessingLog: encoding='utf-8') logfile.write('Started logging at ' + datetime.datetime.now().strftime( - ProcessingLog.DATE_FORMAT).decode('utf-8') + '\n') + ProcessingLog.DATE_FORMAT) + '\n') logfile.close() @staticmethod @@ -70,7 +70,7 @@ class ProcessingLog: # to miss some log info that breaking the algorithm. if msgtype == ProcessingLog.LOG_ALGORITHM: line = msgtype + '|' + datetime.datetime.now().strftime( - ProcessingLog.DATE_FORMAT).decode('utf-8') + '|' \ + ProcessingLog.DATE_FORMAT)+ '|' \ + msg + '\n' logfile = codecs.open(ProcessingLog.logFilename(), 'a', encoding='utf-8')