Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

logoran-logger

logoran3MIT1.0.1

Logging middleware for logoran

logoran, middleware, logger, log

readme

logoran-logger

npm version build status

Development style logger middleware for logoran.

2018-03-09 16:10:21 <-- GET /
--> GET / 200 835ms 746b
2018-03-09 16:10:21 <-- GET /
--> GET / 200 960ms 1.9kb
2018-03-09 16:10:21 <-- GET /users
--> GET /users 200 357ms 922b
2018-03-09 16:10:21 <-- GET /users?page=2
--> GET /users?page=2 200 466ms 4.66kb

Installation

$ npm install logoran-logger

Example

const logger = require('logoran-logger')
const Logoran = require('logoran')

const app = new Logoran()
app.use(logger())

Notes

Recommended that you .use() this middleware near the top to "wrap" all subsequent middleware.

License

MIT

changelog

3.1.0 / 2017-09-26

  • Adds Boom compatibility (#64)

3.0.1 / 2017-06-30

  • Fixes error 'chalk[color] does not return function' when using custom (#61)

3.0.0 / 2017-05-16

  • use async function
  • update bytes to 2.x

2.0.1 / 2017-01-12

  • add color for code 0
  • bump deps

2.0.0 / 2015-11-19

  • add: support for koa 2
  • remove: support for koa 1

1.2.2 / 2014-07-05

  • fix: stop using octal literals for strict mode

1.2.1 / 2014-05-13

  • bump bytes

1.2.0 / 2014-02-12

  • add: add colors and symbols for error and close events
  • remove: only make the method bold

1.1.1 / 2014-01-15

  • fix: use ctx.originalUrl instead of ctx.url

1.1.0 / 2013-12-21

  • add: log the response length of streams
  • add: humanize the response time
  • add: log when response is finished/closed, not caught upstream

1.0.1 / 2013-08-22

  • fix exception handling