Use winston instead of npmlog
This commit is contained in:
parent
a156f05002
commit
35dbc08015
@ -3,7 +3,7 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
|
|
||||||
log: {
|
log: {
|
||||||
level: 'silly'
|
level: process.env.LOG_LEVEL || 'silly'
|
||||||
},
|
},
|
||||||
|
|
||||||
server: {
|
server: {
|
||||||
|
2
index.js
2
index.js
@ -20,7 +20,7 @@
|
|||||||
const cluster = require('cluster');
|
const cluster = require('cluster');
|
||||||
const numCPUs = require('os').cpus().length;
|
const numCPUs = require('os').cpus().length;
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
|
|
||||||
log.level = config.log.level;
|
log.level = config.log.level;
|
||||||
|
|
||||||
|
@ -29,8 +29,8 @@
|
|||||||
"mongodb": "^2.2.31",
|
"mongodb": "^2.2.31",
|
||||||
"nodemailer": "^2.4.2",
|
"nodemailer": "^2.4.2",
|
||||||
"nodemailer-openpgp": "^1.0.2",
|
"nodemailer-openpgp": "^1.0.2",
|
||||||
"npmlog": "^4.0.2",
|
"openpgp": "^2.3.0",
|
||||||
"openpgp": "^2.3.0"
|
"winston": "^2.3.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.1.1",
|
"chai": "^4.1.1",
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const koaBody = require('koa-body');
|
const koaBody = require('koa-body');
|
||||||
const util = require('../service/util');
|
const util = require('../service/util');
|
||||||
@ -58,7 +58,7 @@ exports.parseBody = () => koaBody({
|
|||||||
|
|
||||||
exports.logUnknownError = function(error, ctx) {
|
exports.logUnknownError = function(error, ctx) {
|
||||||
if (error.status) {
|
if (error.status) {
|
||||||
log.verbose('middleware', 'Request faild: %s, %s', error.status, error.message);
|
log.verbose('middleware', `Request failed: ${error.status} ${error.message}`);
|
||||||
} else {
|
} else {
|
||||||
log.error('middleware', 'Unknown error', error, ctx);
|
log.error('middleware', 'Unknown error', error, ctx);
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const MongoClient = require('mongodb').MongoClient;
|
const MongoClient = require('mongodb').MongoClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const util = require('../service/util');
|
const util = require('../service/util');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
|
const openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const init = require('./app');
|
const init = require('./app');
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const util = require('./util');
|
const util = require('./util');
|
||||||
const openpgp = require('openpgp');
|
const openpgp = require('openpgp');
|
||||||
const addressparser = require('addressparser');
|
const addressparser = require('addressparser');
|
||||||
|
@ -5,7 +5,7 @@ const Mongo = require('../../src/dao/mongo');
|
|||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
|
|
||||||
describe('Koa App (HTTP Server) Integration Tests', function() {
|
describe('Koa App (HTTP Server) Integration Tests', function() {
|
||||||
this.timeout(20000);
|
this.timeout(20000);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const Mongo = require('../../src/dao/mongo');
|
const Mongo = require('../../src/dao/mongo');
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const config = require('config');
|
const config = require('config');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
const Email = require('../../src/email/email');
|
const Email = require('../../src/email/email');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const Email = require('../../src/email/email');
|
const Email = require('../../src/email/email');
|
||||||
const nodemailer = require('nodemailer');
|
const nodemailer = require('nodemailer');
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const log = require('npmlog');
|
const log = require('winston');
|
||||||
const openpgp = require('openpgp');
|
const openpgp = require('openpgp');
|
||||||
const PGP = require('../../src/service/pgp');
|
const PGP = require('../../src/service/pgp');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user