mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-09 06:27:06 +01:00
initialize fake logger
This commit is contained in:
parent
aef80ad64c
commit
e1192b1bb3
@ -23,7 +23,7 @@ class HandlerWrapper(handler):
|
|||||||
RH_KEY = handler.RH_KEY
|
RH_KEY = handler.RH_KEY
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(logger=FakeLogger, *args, **kwargs)
|
super().__init__(logger=FakeLogger(), *args, **kwargs)
|
||||||
|
|
||||||
return HandlerWrapper
|
return HandlerWrapper
|
||||||
|
|
||||||
|
@ -232,14 +232,14 @@ def __init__(self, logger, *args, **kwargs):
|
|||||||
def emit(self, record):
|
def emit(self, record):
|
||||||
try:
|
try:
|
||||||
msg = self.format(record)
|
msg = self.format(record)
|
||||||
|
except Exception:
|
||||||
|
self.handleError(record)
|
||||||
|
else:
|
||||||
if record.levelno >= logging.ERROR:
|
if record.levelno >= logging.ERROR:
|
||||||
self._logger.error(msg)
|
self._logger.error(msg)
|
||||||
else:
|
else:
|
||||||
self._logger.stdout(msg)
|
self._logger.stdout(msg)
|
||||||
|
|
||||||
except Exception:
|
|
||||||
self.handleError(record)
|
|
||||||
|
|
||||||
|
|
||||||
@register_rh
|
@register_rh
|
||||||
class RequestsRH(RequestHandler, InstanceStoreMixin):
|
class RequestsRH(RequestHandler, InstanceStoreMixin):
|
||||||
|
Loading…
Reference in New Issue
Block a user