Open
Description
Expexted behaviour:
Using this formatter the log output will include a timestamp.
logging.Formatter('%(asctime)s | %(name)s | %(levelname)s - %(message)s')
Like this:
Tue Feb 17 09:42:58 2009 | MAIN | INFO - test
Actual behaviour:
Timestamp will always be None
None | MAIN | INFO - test
Cause:
The formatTime() method checks for the strftime attribute, which does not exist in the Micropython implementation:
def formatTime(self, datefmt, record):
if hasattr(time, "strftime"):
return time.strftime(datefmt, time.localtime(record.ct))
return None
Metadata
Metadata
Assignees
Labels
No labels