five-bells-shared
Advanced tools
Comparing version 17.0.0 to 18.0.0
@@ -155,7 +155,4 @@ 'use strict' | ||
// When using SQLite in-memory database, default to sync enabled | ||
const sync = castBool(getEnv(prefix, 'DB_SYNC'), uri === 'sqlite://') | ||
const sync = castBool(getEnv(prefix, 'DB_SYNC'), _.startsWith(uri, 'sqlite://')) | ||
// Knex | ||
const knexEnv = getEnv(prefix, 'DB_KNEX_ENV') || 'development' | ||
// User for connecting to DB | ||
@@ -168,3 +165,2 @@ const connectionUser = getEnv(prefix, 'DB_CONNECTION_USER') | ||
sync, | ||
knex_env: knexEnv, | ||
connection_user: connectionUser, | ||
@@ -171,0 +167,0 @@ connection_password: connectionPassword |
{ | ||
"name": "five-bells-shared", | ||
"version": "17.0.0", | ||
"version": "18.0.0", | ||
"description": "Shared components for Five Bells projects.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -30,11 +30,32 @@ # Five Bells Shared [![npm][npm-image]][npm-url] [![circle][circle-image]][circle-url] [![codecov][codecov-image]][codecov-url] | ||
Set up the logger somewhere in your top-level app: | ||
``` js | ||
const log = require('five-bells-shared/services/log')('transfers'); | ||
const hub = require('mag-hub') | ||
const mag = require('mag') | ||
const log = require('five-bells-shared/lib/log') | ||
log.debug('very boring information'); | ||
log.info('somewhat useful information'); | ||
log.warn('sort of important information'); | ||
log.error('super-important information'); | ||
module.exports = log(mag, hub) | ||
``` | ||
Then use it from anywhere using `require('mag')`: | ||
``` js | ||
const log = require('mag')('transfers') | ||
log.debug('very boring information') | ||
log.info('somewhat useful information') | ||
log.warn('sort of important information') | ||
log.error('super-important information') | ||
``` | ||
### Caveat | ||
If you're using `mag` in a module which is `npm link`ed, it will receive its own instance of `mag` and messages will not be formatted correctly. To solve this problem, you can install the `mag` module globally and link it in all of your local modules: | ||
``` sh | ||
sudo npm install -g mag | ||
npm link mag # in each module directory | ||
``` | ||
## Log Test Helper | ||
@@ -41,0 +62,0 @@ |
@@ -7,9 +7,5 @@ { | ||
"properties": { | ||
"ledger": { | ||
"description": "The ledger where the transfer will take place", | ||
"$ref": "Iri.json" | ||
}, | ||
"account": { | ||
"description": "Account holding the funds", | ||
"$ref": "Iri.json" | ||
"$ref": "IlpAddress.json" | ||
}, | ||
@@ -16,0 +12,0 @@ "amount": { |
@@ -9,4 +9,4 @@ { | ||
"properties": { | ||
"source_ledger": {"$ref": "Iri.json"}, | ||
"destination_ledger": {"$ref": "Iri.json"}, | ||
"source_ledger": {"$ref": "IlpAddress.json"}, | ||
"destination_ledger": {"$ref": "IlpAddress.json"}, | ||
"connector": { | ||
@@ -22,7 +22,7 @@ "$ref": "Iri.json", | ||
"source_account": { | ||
"$ref": "Iri.json", | ||
"$ref": "IlpAddress.json", | ||
"description": "the connector's account on source_ledger" | ||
}, | ||
"destination_account": { | ||
"$ref": "Iri.json", | ||
"$ref": "IlpAddress.json", | ||
"description": "the connector's account on destination_ledger; (this property is only for local routes)" | ||
@@ -29,0 +29,0 @@ }, |
@@ -304,3 +304,2 @@ 'use strict' | ||
const testDefaults = { | ||
knex_env: 'development', | ||
sync: true, | ||
@@ -325,3 +324,2 @@ uri: 'sqlite://' | ||
const db = _.defaults({ | ||
knex_env: 'development', | ||
sync: true, | ||
@@ -338,3 +336,2 @@ uri: 'localhost:5000' | ||
const db = _.defaults({ | ||
knex_env: 'development', | ||
uri: 'localhost:5000' | ||
@@ -341,0 +338,0 @@ }, defaults) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2007295
155
105
5435