Skip to content

Commit

Permalink
Merge branch 'release/4.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
yentsun committed Apr 2, 2018
2 parents bac5c37 + 55653e5 commit b590689
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,9 @@
[4.0.1] - 2018-04-02
--------------------
- [x] Fix error detail tests
- [x] Drop `moment` dependency


[4.0.0] - 2018-04-02
--------------------
- [x] Remove `respond` callback from `listen`
Expand Down
6 changes: 4 additions & 2 deletions lib/logger.js
@@ -1,5 +1,4 @@
const winston = require('winston');
const moment = require('moment');
const screenPassword = require('./screenPassword');


Expand All @@ -13,7 +12,10 @@ module.exports = function (group, format) {
transports: [
new (winston.transports.Console)({
level: process.env.NATS_LOG_LEVEL || 'debug',
timestamp: function () { return moment().toISOString() },
timestamp: function () {
const now = new Date();
return now.toISOString()
},
formatter,
stderrLevels: ['error']
})
Expand Down
7 changes: 1 addition & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "tasu",
"version": "4.0.0",
"version": "4.0.1",
"description": "A NATS-based message transport for Node.js services",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -32,7 +32,6 @@
"homepage": "https://github.com/yentsun/tasu",
"dependencies": {
"lodash": "^4.17.5",
"moment": "^2.21.0",
"nats": "^0.7.29",
"trid": "^0.1.0",
"winston": "^2.4.1"
Expand Down
3 changes: 2 additions & 1 deletion test.js
Expand Up @@ -52,6 +52,7 @@ describe('tasu: options set', () => {
tasu.listen('request.error.detail', (message) => {
const error = Error('service error');
error.detail = 'error detail';
delete error.message;
throw error;
});
done();
Expand Down Expand Up @@ -89,7 +90,7 @@ describe('tasu: options set', () => {
try {
await tasu.request('request.error.detail', {foo: 'bar'});
} catch (error) {
assert.equal(error.message, 'service error');
assert.equal(error.message, 'error detail');
assert.isOk(error.requestId);
}
});
Expand Down

0 comments on commit b590689

Please sign in to comment.