kopia lustrzana https://github.com/micropython/micropython-lib
uasyncio: Add own set_debug() function.
set_debug() from uasyncio.core doesn't have effect on the main uasyncio package, so let them both have set_debug() function, and allow to enable debug logging independently.pull/188/head
rodzic
a4b75ab2bf
commit
a2097be138
|
@ -4,6 +4,17 @@ import usocket as _socket
|
||||||
from uasyncio.core import *
|
from uasyncio.core import *
|
||||||
|
|
||||||
|
|
||||||
|
DEBUG = 0
|
||||||
|
log = None
|
||||||
|
|
||||||
|
def set_debug(val):
|
||||||
|
global DEBUG, log
|
||||||
|
DEBUG = val
|
||||||
|
if val:
|
||||||
|
import logging
|
||||||
|
log = logging.getLogger("uasyncio")
|
||||||
|
|
||||||
|
|
||||||
class PollEventLoop(EventLoop):
|
class PollEventLoop(EventLoop):
|
||||||
|
|
||||||
def __init__(self, len=42):
|
def __init__(self, len=42):
|
||||||
|
|
Ładowanie…
Reference in New Issue