Some logging cleanup.

This commit is contained in:
Evelyn Eastmond authored and Ray Schamp committed 2018-07-09 13:49:41 -04:00
1 parent 387f03b08c
commit d79efbece8
3 files changed
+5 -5

No files matched your search

+1 -2
View File
@@ -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);
}
}
+2 -2
View File
@@ -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);
}
}
+2 -1
View File
@@ -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);
}