Skip to content

Commit af62075

Browse files
author
Chris Clark
committed
Fix trace option
1 parent a76b554 commit af62075

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/common/connection.js

+7
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class Connection extends EventEmitter {
1616
constructor(url, options = {}) {
1717
super();
1818
this._url = url;
19+
this._trace = options.trace;
1920
this._proxyURL = options.proxy;
2021
this._proxyAuthorization = options.proxyAuthorization;
2122
this._authorization = options.authorization;
@@ -52,6 +53,9 @@ class Connection extends EventEmitter {
5253

5354
_onMessage(message) {
5455
let parameters;
56+
if (this._trace) {
57+
console.log(message);
58+
}
5559
try {
5660
parameters = this._parseMessage(message);
5761
} catch (error) {
@@ -191,6 +195,9 @@ class Connection extends EventEmitter {
191195
}
192196

193197
_send(message) {
198+
if (this._trace) {
199+
console.log(message);
200+
}
194201
return new Promise((resolve, reject) => {
195202
this._ws.send(message, undefined, (error, result) => {
196203
if (error) {

0 commit comments

Comments
 (0)