File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1818import json
1919import time
2020import ssl
21+ import logging
22+ import sys
2123try :
2224 import thread
2325except ImportError :
@@ -40,7 +42,8 @@ def __init__(self,
4042 headers ,
4143 http_proxy_host = None ,
4244 http_proxy_port = None ,
43- verify = None ):
45+ verify = None ,
46+ debug = False ):
4447 self .audio_source = audio_source
4548 self .options = options
4649 self .callback = callback
@@ -51,7 +54,9 @@ def __init__(self,
5154 self .isListening = False
5255 self .verify = verify
5356
54- # websocket.enableTrace(True)
57+ if debug :
58+ logging .basicConfig (stream = sys .stdout , level = logging .DEBUG )
59+ websocket .enableTrace (True )
5560
5661 self .ws_client = websocket .WebSocketApp (
5762 self .url ,
Original file line number Diff line number Diff line change 1818import json
1919import ssl
2020import time
21+ import logging
22+ import sys
2123try :
2224 import thread
2325except ImportError :
@@ -34,7 +36,8 @@ def __init__(self,
3436 headers ,
3537 http_proxy_host = None ,
3638 http_proxy_port = None ,
37- verify = None ):
39+ verify = None ,
40+ debug = False ):
3841 self .options = options
3942 self .callback = callback
4043 self .url = url
@@ -43,7 +46,9 @@ def __init__(self,
4346 self .http_proxy_port = http_proxy_port
4447 self .verify = verify
4548
46- # websocket.enableTrace(True)
49+ if debug :
50+ logging .basicConfig (stream = sys .stdout , level = logging .DEBUG )
51+ websocket .enableTrace (True )
4752
4853 self .ws_client = websocket .WebSocketApp (
4954 self .url ,
You can’t perform that action at this time.
0 commit comments