Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[processing] write log dates in ISO format
fixes #13226
  • Loading branch information
volaya committed Oct 1, 2015
1 parent e27f6a1 commit e8003f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/plugins/processing/core/ProcessingLog.py
Expand Up @@ -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
Expand All @@ -53,7 +53,7 @@ def startLogging():
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
Expand All @@ -70,7 +70,7 @@ def addToLog(msgtype, msg):
# 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')
Expand Down

0 comments on commit e8003f2

Please sign in to comment.