kopia lustrzana https://github.com/micropython/micropython-lib
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
rodzic
58bab0add3
commit
8a7eb40009
|
@ -3,9 +3,6 @@ from micropython import const
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
|
|
||||||
if hasattr(time, "strftime"):
|
|
||||||
from time import strftime
|
|
||||||
|
|
||||||
CRITICAL = const(50)
|
CRITICAL = const(50)
|
||||||
ERROR = const(40)
|
ERROR = const(40)
|
||||||
WARNING = const(30)
|
WARNING = const(30)
|
||||||
|
@ -92,7 +89,7 @@ class Formatter:
|
||||||
|
|
||||||
def formatTime(self, datefmt, record):
|
def formatTime(self, datefmt, record):
|
||||||
if hasattr(time, "strftime"):
|
if hasattr(time, "strftime"):
|
||||||
return strftime(datefmt, time.localtime(record.ct))
|
return time.strftime(datefmt, time.localtime(record.ct))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def format(self, record):
|
def format(self, record):
|
||||||
|
|
Ładowanie…
Reference in New Issue