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 18
18
import json
19
19
import time
20
20
import ssl
21
+ import logging
22
+ import sys
21
23
try :
22
24
import thread
23
25
except ImportError :
@@ -40,7 +42,8 @@ def __init__(self,
40
42
headers ,
41
43
http_proxy_host = None ,
42
44
http_proxy_port = None ,
43
- verify = None ):
45
+ verify = None ,
46
+ debug = False ):
44
47
self .audio_source = audio_source
45
48
self .options = options
46
49
self .callback = callback
@@ -51,7 +54,9 @@ def __init__(self,
51
54
self .isListening = False
52
55
self .verify = verify
53
56
54
- # websocket.enableTrace(True)
57
+ if debug :
58
+ logging .basicConfig (stream = sys .stdout , level = logging .DEBUG )
59
+ websocket .enableTrace (True )
55
60
56
61
self .ws_client = websocket .WebSocketApp (
57
62
self .url ,
Original file line number Diff line number Diff line change 18
18
import json
19
19
import ssl
20
20
import time
21
+ import logging
22
+ import sys
21
23
try :
22
24
import thread
23
25
except ImportError :
@@ -34,7 +36,8 @@ def __init__(self,
34
36
headers ,
35
37
http_proxy_host = None ,
36
38
http_proxy_port = None ,
37
- verify = None ):
39
+ verify = None ,
40
+ debug = False ):
38
41
self .options = options
39
42
self .callback = callback
40
43
self .url = url
@@ -43,7 +46,9 @@ def __init__(self,
43
46
self .http_proxy_port = http_proxy_port
44
47
self .verify = verify
45
48
46
- # websocket.enableTrace(True)
49
+ if debug :
50
+ logging .basicConfig (stream = sys .stdout , level = logging .DEBUG )
51
+ websocket .enableTrace (True )
47
52
48
53
self .ws_client = websocket .WebSocketApp (
49
54
self .url ,
You can’t perform that action at this time.
0 commit comments