kopia lustrzana https://github.com/micropython/micropython-lib
logging: Add exc() and exception() methods.
Non-standard exc() method accepts exception instance to log as a parameter. exception() just uses sys.exc_info().pull/261/merge
rodzic
09c59c4704
commit
b97fe09ed9
|
@ -59,6 +59,13 @@ class Logger:
|
|||
def critical(self, msg, *args):
|
||||
self.log(CRITICAL, msg, *args)
|
||||
|
||||
def exc(self, e, msg, *args):
|
||||
self.log(ERROR, msg, *args)
|
||||
sys.print_exception(e, _stream)
|
||||
|
||||
def exception(self, msg, *args):
|
||||
self.exc(sys.exc_info()[1], msg, *args)
|
||||
|
||||
|
||||
_level = INFO
|
||||
_loggers = {}
|
||||
|
|
Ładowanie…
Reference in New Issue