Skip to content

Commit

Permalink
Adds some logging (henryboldi#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank Cash authored and greg-js committed Sep 22, 2016
1 parent a9921ed commit 2329b81
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions app/actions/AliasesActions.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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);
}
}
}
Expand All @@ -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);
}
}
}
6 changes: 4 additions & 2 deletions app/actions/KeychainActions.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
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) {
try {
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);
}
}
}
Expand All @@ -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);
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 2329b81

Please sign in to comment.