Skip to content

Commit

Permalink
Merge pull request #6 from pebble/fix-req-data
Browse files Browse the repository at this point in the history
Fix req data
  • Loading branch information
aheckmann committed Oct 26, 2015
2 parents f158b58 + 4a50b30 commit a914dd7
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- 0.11
- node

script: "make test-travis"
after_script: "npm install coveralls@2.11.1 && cat ./coverage/lcov.info | coveralls"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ lint: index.js
@ $(LINT) index.js

test: .PHONY
@ node --harmony $(MOCHA)
@ node $(MOCHA)

test-cov: .PHONY
@ node --harmony $(ISTANBUL) cover $(MOCHA)
@ node $(ISTANBUL) cover $(MOCHA)

test-travis: lint test-cov
@ node --harmony $(ISTANBUL) check-coverage
@ node $(ISTANBUL) check-coverage

.PHONY:
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,15 @@ app.use(koaBunyanLogger.timeContext({
}));
```
### bunyan export
The internal copy of bunyan is exported as `.bunyan`:
```js
var koaBunyanLogger = require('koa-bunyan-logger');
var bunyan = koaBunyanLogger.bunyan;
```
## Sponsored by
[Pebble Technology!](https://getpebble.com)
Expand Down
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ module.exports.requestIdContext = function (opts) {
* - updateRequestLogFields: function (requestData)
* - updateResponseLogFields: function (responseData)
* - formatRequestMessage: function (requestData)
* - formatReponseMessage: function (responseData)
* - formatResponseMessage: function (responseData)
*/
module.exports.requestLogger = function (opts) {
opts = opts || {};
Expand Down Expand Up @@ -127,7 +127,7 @@ module.exports.requestLogger = function (opts) {
var url = this.url;

var requestData = {
req: this.request
req: this.req
};

requestData = updateFields(this, opts.updateLogFields, requestData);
Expand Down Expand Up @@ -257,3 +257,5 @@ module.exports.timeContext = function (opts) {
}
};

// Export our copy of bunyan
module.exports.bunyan = bunyan;
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@
"author": "Pebble Technology <webteam@getpebble.com>",
"license": "MIT",
"dependencies": {
"bunyan": "~1.1.3",
"bunyan": "~1.5.0",
"node-uuid": "~1.4.1",
"on-finished": "~2.1.1"
},
"devDependencies": {
"co-mocha": "~1.0.3",
"co-supertest": "~0.0.7",
"istanbul-harmony": "~0.3.0",
"co-mocha": "~1.1.2",
"co-supertest": "~0.0.10",
"istanbul": "~0.4.0",
"jshint": "~2.5.8",
"koa": "~0.13.0",
"mocha": "~2.0.1",
"supertest": "~0.14.0"
"koa": "~1.1.1",
"mocha": "~2.3.3",
"supertest": "~1.1.0"
}
}

0 comments on commit a914dd7

Please sign in to comment.