From 2329b8115f298e403453879e1ba89910a8daccfd Mon Sep 17 00:00:00 2001 From: Frank Cash Date: Tue, 16 Aug 2016 20:52:27 -0400 Subject: [PATCH] Adds some logging (#12) --- app/actions/AliasesActions.js | 8 +++++--- app/actions/KeychainActions.js | 6 ++++-- package.json | 3 ++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/actions/AliasesActions.js b/app/actions/AliasesActions.js index 1db3747..3df6f72 100644 --- a/app/actions/AliasesActions.js +++ b/app/actions/AliasesActions.js @@ -1,6 +1,7 @@ import * as types from '../constants/AliasesConstants' import db from '../config/database.js' -import { generateKey } from '../utils/pgp' +import { generateKey } from '../../utils/pgp' +let log = require('electron-log'); export function addAlias(alias) { return async function dispatchAction(dispatch) { @@ -9,7 +10,8 @@ export function addAlias(alias) { const insertedAlias = await db('aliases').insert(alias) return dispatch({ type: types.ADD_KEY, alias: insertedAlias }) } catch (err) { - return console.log(err) + console.log(err) + log.warn(err); } } } @@ -24,7 +26,7 @@ export function fetchAliases() { const aliases = await db('aliases').value() return dispatch(setAliases(aliases)) } catch (err) { - return console.log(err) + log.warn(err); } } } diff --git a/app/actions/KeychainActions.js b/app/actions/KeychainActions.js index 00f0c3a..2d34398 100644 --- a/app/actions/KeychainActions.js +++ b/app/actions/KeychainActions.js @@ -1,5 +1,6 @@ import * as types from '../constants/KeychainConstants' import db from '../config/database.js' +let log = require('electron-log'); export function addKey(key) { return async function dispatchAction(dispatch) { @@ -7,7 +8,8 @@ export function addKey(key) { const insertedKey = await db('keychain').insert(key) return dispatch({ type: types.ADD_KEY, key: insertedKey }) } catch (err) { - return console.log(err) + console.log(err) + log.warn(err); } } } @@ -22,7 +24,7 @@ export function fetchKeychain() { const keychain = await db('keychain').value() return dispatch(setKeychain(keychain)) } catch (err) { - return console.log(err) + log.warn(err); } } } diff --git a/package.json b/package.json index 2fdda7d..42151aa 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "babel-preset-stage-0": "^6.5.0", "babel-register": "^6.7.2", "chai": "^3.5.0", - "chromedriver": "^2.21.2", + "chromedriver": "2.21.2", "co-mocha": "^1.1.2", "concurrently": "^2.0.0", "cross-env": "^1.0.7", @@ -105,6 +105,7 @@ "css-modules-require-hook": "^4.0.0", "dynamics.js": "^0.0.9", "electron-debug": "^0.6.0", + "electron-log": "^1.0.17", "font-awesome": "^4.6.1", "immutable": "^3.7.6", "isomorphic-fetch": "^2.2.1",