Skip to content

Commit a2097be

Browse files
committed
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.
1 parent a4b75ab commit a2097be

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

uasyncio/uasyncio/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
from uasyncio.core import *
55

66

7+
DEBUG = 0
8+
log = None
9+
10+
def set_debug(val):
11+
global DEBUG, log
12+
DEBUG = val
13+
if val:
14+
import logging
15+
log = logging.getLogger("uasyncio")
16+
17+
718
class PollEventLoop(EventLoop):
819

920
def __init__(self, len=42):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy