diff --git a/src/io/bleSession.js b/src/io/bleSession.js index 983399c90..600373ea3 100644 --- a/src/io/bleSession.js +++ b/src/io/bleSession.js @@ -138,8 +138,7 @@ class BLESession extends JSONRPCWebSocket { _sendError (e) { this._connected = false; - log.error(`BLESession error:`); - log.error(e); + log.error(`BLESession error: ${e}`); this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR); } } diff --git a/src/io/btSession.js b/src/io/btSession.js index 7d1f6a4c8..d0dfea3c7 100644 --- a/src/io/btSession.js +++ b/src/io/btSession.js @@ -10,6 +10,7 @@ class BTSession extends JSONRPCWebSocket { * @param {Runtime} runtime - the Runtime for sending/receiving GUI update events. * @param {object} deviceOptions - the list of options for device discovery. * @param {object} connectCallback - a callback for connection. + * @param {object} messageCallback - a callback for message sending. */ constructor (runtime, deviceOptions, connectCallback, messageCallback) { const ws = new WebSocket(ScratchLinkWebSocket); @@ -107,8 +108,7 @@ class BTSession extends JSONRPCWebSocket { } _sendError (e) { - log.error(`BLESession error:`); - log.error(e); + log.error(`BLESession error: ${e}`); this._runtime.emit(this._runtime.constructor.PERIPHERAL_ERROR); } } diff --git a/src/util/jsonrpc-web-socket.js b/src/util/jsonrpc-web-socket.js index 39b60b92b..c06a269b5 100644 --- a/src/util/jsonrpc-web-socket.js +++ b/src/util/jsonrpc-web-socket.js @@ -1,4 +1,5 @@ const JSONRPC = require('./jsonrpc'); +const log = require('../util/log'); class JSONRPCWebSocket extends JSONRPC { constructor (webSocket) { @@ -28,7 +29,7 @@ class JSONRPCWebSocket extends JSONRPC { _onSocketMessage (e) { const json = JSON.parse(e.data); if (json.method !== 'characteristicDidChange') { - console.log('received message: ' + JSON.stringify(json)); + // log.info(`received message: ${json}`); } this._handleMessage(json); }