From 82aa857ffdccab9ca270452989c58a4b5c678d4e Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 25 Sep 2017 23:25:54 -0400 Subject: [PATCH] Use log library instead of ipc log --- lib/blootstrap/index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/blootstrap/index.js b/lib/blootstrap/index.js index 749c88a..f015ff7 100644 --- a/lib/blootstrap/index.js +++ b/lib/blootstrap/index.js @@ -1,6 +1,7 @@ 'use strict' const ipc = require('node-ipc') +const log = require('../log')('ble') function capitalize (s) { return s[0].toUpperCase() + s.slice(1) @@ -12,20 +13,20 @@ class Blootstrap { this._onData = () => {} ipc.connectTo('blootstrap_ble', () => { ipc.of.blootstrap_ble.on('connect', () => { - ipc.log(`Connected to the blootstrap_ble service`) + log.info('connect', `Connected to the blootstrap_ble service`) }) ipc.of.blootstrap_ble.on('data', data => { const str = data.toString() - ipc.log(str) + log.info('data', str) this._onData(str) }) ipc.of.blootstrap_ble.on('disconnect', () => { - ipc.log(`Disconnected from the blootstrap_ble service`) + log.info('disconnect', `Disconnected from the blootstrap_ble service`) }) ipc.of.blootstrap_ble.on('error', (err) => { if (err.code === 'EACCES') { - console.log(`Cannot access ipc`) + log.warn('error', `Cannot access ipc`) } }) })