Skip to content

Commit

Permalink
Updated dependencies (#92)
Browse files Browse the repository at this point in the history
* Updated dependencies

* Node v14 is not released yet (lol)
  • Loading branch information
mcollina authored Apr 4, 2020
1 parent 13c6fc0 commit 57fc852
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
language: node_js
sudo: false
node_js:
- '6'
- '8'
- '10'
- '12'
- '13'
script:
- npm run ci
env:
Expand Down
2 changes: 1 addition & 1 deletion logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function pinoLogger (opts, stream) {
var shouldLogSuccess = true

req.id = genReqId(req)
req.log = res.log = logger.child({[reqKey]: req})
req.log = res.log = logger.child({ [reqKey]: req })
res[startTime] = res[startTime] || Date.now()

if (autoLogging) {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
"main": "logger.js",
"dependencies": {
"fast-url-parser": "^1.1.3",
"pino": "^5.0.0",
"pino": "^6.0.0",
"pino-std-serializers": "^2.4.0"
},
"devDependencies": {
"autocannon": "^2.4.1",
"autocannon": "^4.0.0",
"coveralls": "^3.0.0",
"http-ndjson": "^3.1.0",
"pre-commit": "^1.1.2",
"split2": "^2.2.0",
"standard": "^11.0.0",
"tap": "^12.0.0"
"split2": "^3.0.0",
"standard": "^14.0.0",
"tap": "^14.0.0"
},
"scripts": {
"benchmark": "./scripts/benchmark-all",
Expand Down
33 changes: 20 additions & 13 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ test('uses the log level passed in as an option', function (t) {

test('uses the custom log level passed in as an option', function (t) {
var dest = split(JSON.parse)
var logger = pinoHttp({ customLogLevel: function (res, err) {
return 'warn'
}}, dest)
var logger = pinoHttp({
customLogLevel: function (res, err) {
return 'warn'
}
}, dest)

setup(t, logger, function (err, server) {
t.error(err)
Expand All @@ -133,9 +135,10 @@ test('throw error if custom log level and log level passed in together', functio
useLevel: 'info',
customLogLevel: function (res, err) {
return 'warn'
}}, dest)
}
}, dest)
}
t.throws(throwFunction, {message: "You can't pass 'useLevel' and 'customLogLevel' together"})
t.throws(throwFunction, { message: "You can't pass 'useLevel' and 'customLogLevel' together" })
t.end()
})

Expand Down Expand Up @@ -170,7 +173,7 @@ test('uses a custom genReqId function', function (t) {
return idToTest
}

var logger = pinoHttp({genReqId: genReqId}, dest)
var logger = pinoHttp({ genReqId: genReqId }, dest)
setup(t, logger, function (err, server) {
t.error(err)
doGet(server)
Expand Down Expand Up @@ -560,7 +563,7 @@ test('res.raw is not enumerable', function (t) {
logger: pino(dest),
serializers: {
res: function (res) {
t.is(res.propertyIsEnumerable('raw'), false)
t.is(Object.prototype.propertyIsEnumerable.call(res, 'raw'), false)
return res
}
}
Expand Down Expand Up @@ -606,9 +609,11 @@ test('req.id has a non-function value', function (t) {
test('uses the custom successMessage callback if passed in as an option', function (t) {
var dest = split(JSON.parse)
var customResponseMessage = 'Custom response message'
var logger = pinoHttp({ customSuccessMessage: function () {
return customResponseMessage
}}, dest)
var logger = pinoHttp({
customSuccessMessage: function () {
return customResponseMessage
}
}, dest)

setup(t, logger, function (err, server) {
t.error(err)
Expand All @@ -624,9 +629,11 @@ test('uses the custom successMessage callback if passed in as an option', functi
test('uses the custom errorMessage callback if passed in as an option', function (t) {
var dest = split(JSON.parse)
var customErrorMessage = 'Custom error message'
var logger = pinoHttp({ customErrorMessage: function () {
return customErrorMessage
}}, dest)
var logger = pinoHttp({
customErrorMessage: function () {
return customErrorMessage
}
}, dest)

setup(t, logger, function (err, server) {
t.error(err)
Expand Down

0 comments on commit 57fc852

Please sign in to comment.