koa-logger
Advanced tools
Comparing version 3.2.0 to 3.2.1
23
index.js
@@ -48,3 +48,3 @@ | ||
return function printFunc (...args) { | ||
let str = util.format(...args) | ||
const str = util.format(...args) | ||
if (transporter) { | ||
@@ -60,8 +60,8 @@ transporter(str, args) | ||
// request | ||
const start = Date.now() | ||
const start = ctx[Symbol.for('request-received.startTime')] ? ctx[Symbol.for('request-received.startTime')].getTime() : Date.now() | ||
print(' ' + chalk.gray('<--') + | ||
' ' + chalk.bold('%s') + | ||
' ' + chalk.gray('%s'), | ||
ctx.method, | ||
ctx.originalUrl) | ||
ctx.method, | ||
ctx.originalUrl) | ||
@@ -118,3 +118,4 @@ try { | ||
const s = status / 100 | 0 | ||
const color = colorCodes.hasOwnProperty(s) ? colorCodes[s] : 0 | ||
// eslint-disable-next-line | ||
const color = colorCodes.hasOwnProperty(s) ? colorCodes[s] : colorCodes[0] | ||
@@ -133,3 +134,3 @@ // get the human readable response length | ||
: event === 'close' ? chalk.yellow('-x-') | ||
: chalk.gray('-->') | ||
: chalk.gray('-->') | ||
@@ -142,7 +143,7 @@ print(' ' + upstream + | ||
' ' + chalk.gray('%s'), | ||
ctx.method, | ||
ctx.originalUrl, | ||
status, | ||
time(start), | ||
length) | ||
ctx.method, | ||
ctx.originalUrl, | ||
status, | ||
time(start), | ||
length) | ||
} | ||
@@ -149,0 +150,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/logger", | ||
"version": "3.2.0", | ||
"version": "3.2.1", | ||
"keywords": [ | ||
@@ -18,24 +18,25 @@ "koa", | ||
"lint": "eslint --fix .", | ||
"test": "mocha test.js" | ||
"test": "mocha test.js --exit" | ||
}, | ||
"devDependencies": { | ||
"boom": "^5.2.0", | ||
"chai": "^3.5.0", | ||
"eslint": "^3.19.0", | ||
"eslint-config-standard": "^10.2.1", | ||
"eslint-plugin-import": "^2.2.0", | ||
"eslint-plugin-node": "^4.2.2", | ||
"eslint-plugin-promise": "^3.5.0", | ||
"eslint-plugin-standard": "^3.0.1", | ||
"koa": "^2.0.0-alpha.7", | ||
"boom": "^7.3.0", | ||
"chai": "^4.2.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-standard": "^13.0.1", | ||
"eslint-plugin-import": "^2.18.0", | ||
"eslint-plugin-node": "^9.1.0", | ||
"eslint-plugin-promise": "^4.2.1", | ||
"eslint-plugin-standard": "^4.0.0", | ||
"koa": "^2.7.0", | ||
"koa-compress": "^3.0.0", | ||
"koa-route": "^3.2.0", | ||
"mocha": "^3.2.0", | ||
"sinon": "^1.17.7", | ||
"sinon-chai": "^2.8.0", | ||
"supertest": "^2.0.1" | ||
"mocha": "^6.1.4", | ||
"sinon": "^7.3.2", | ||
"sinon-chai": "^3.3.0", | ||
"supertest": "^4.0.2" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"bytes": "^2.5.0", | ||
"chalk": "^1.1.3", | ||
"bytes": "^3.1.0", | ||
"chalk": "^2.4.2", | ||
"humanize-number": "0.0.2", | ||
@@ -42,0 +43,0 @@ "passthrough-counter": "^1.0.0" |
@@ -7,3 +7,3 @@ | ||
Development style logger middleware for [koa](https://github.com/koajs/koa). | ||
Development style logger middleware for [koa](https://github.com/koajs/koa). Compatible with [request-received](https://github.com/cabinjs/request-received). | ||
@@ -10,0 +10,0 @@ ___Notice: `koa-logger@2` supports `koa@2`; if you want to use this module with `koa@1`, please use `koa-logger@1`.___ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7340
133
15
+ Addedansi-styles@3.2.1(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedchalk@2.4.2(transitive)
+ Addedcolor-convert@1.9.3(transitive)
+ Addedcolor-name@1.1.3(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removedansi-regex@2.1.1(transitive)
- Removedansi-styles@2.2.1(transitive)
- Removedbytes@2.5.0(transitive)
- Removedchalk@1.1.3(transitive)
- Removedhas-ansi@2.0.0(transitive)
- Removedstrip-ansi@3.0.1(transitive)
- Removedsupports-color@2.0.0(transitive)
Updatedbytes@^3.1.0
Updatedchalk@^2.4.2