Skip to content

Commit

Permalink
Merge 21e684c into 9029b37
Browse files Browse the repository at this point in the history
  • Loading branch information
c0d3rman committed Jun 11, 2014
2 parents 9029b37 + 21e684c commit f23f1ed
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,23 @@ exports.format('dev', function(tokens, req, res){
return fn(tokens, req, res);
});

/**
* dev+ (dev with more information)
*/

exports.format('dev+', function(tokens, req, res){
var color = 32; // green
var status = res.statusCode;

if (status >= 500) color = 31; // red
else if (status >= 400) color = 33; // yellow
else if (status >= 300) color = 36; // cyan

var fn = compile('\x1b[90m:remote-addr \x1b[32m:method \x1b[35m:url \x1b[/' + color + 'm:status \x1b[97m:response-time ms\x1b[0m');

return fn(tokens, req, res);
});

/**
* request url
*/
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "morgan",
"description": "http request logger middleware for node.js",
"version": "1.1.1",
"version": "1.2.0",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
Expand Down

0 comments on commit f23f1ed

Please sign in to comment.