logging: Simplify check for strftime.

Only needs to be checked at the call site.

Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
pull/589/head
Jim Mussared 2022-12-21 12:08:43 +11:00
rodzic 58bab0add3
commit 8a7eb40009
1 zmienionych plików z 1 dodań i 4 usunięć

Wyświetl plik

@ -3,9 +3,6 @@ from micropython import const
import sys
import time
if hasattr(time, "strftime"):
from time import strftime
CRITICAL = const(50)
ERROR = const(40)
WARNING = const(30)
@ -92,7 +89,7 @@ class Formatter:
def formatTime(self, datefmt, record):
if hasattr(time, "strftime"):
return strftime(datefmt, time.localtime(record.ct))
return time.strftime(datefmt, time.localtime(record.ct))
return None
def format(self, record):