@knowlearning/agents 0.9.185 → 0.9.186
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/browser/root.js +7 -0
- package/package.json +1 -1
package/agents/browser/root.js
CHANGED
|
@@ -50,6 +50,8 @@ export default options => {
|
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
this.send = message => {
|
|
53
|
+
// TODO: more sophisticated enable/disable of debug messaging
|
|
54
|
+
debugLog('SEND', message)
|
|
53
55
|
try {
|
|
54
56
|
socket.emit('message', message)
|
|
55
57
|
} catch (err) {
|
|
@@ -67,6 +69,7 @@ export default options => {
|
|
|
67
69
|
})
|
|
68
70
|
|
|
69
71
|
socket.on('message', (data) => {
|
|
72
|
+
debugLog('RECV', data)
|
|
70
73
|
if (this.onmessage) this.onmessage(data)
|
|
71
74
|
})
|
|
72
75
|
|
|
@@ -110,3 +113,7 @@ export default options => {
|
|
|
110
113
|
|
|
111
114
|
return agent
|
|
112
115
|
}
|
|
116
|
+
|
|
117
|
+
function debugLog() {
|
|
118
|
+
if (localStorage.getItem('__default_knowlearning_agent.debug')) console.log(...arguments)
|
|
119
|
+
}
|