Browse files

Allow retval `== null` from logger callback

  • Loading branch information...
1 parent ef0f070 commit 07753e7fbf7718428e7da25513720e267fb147f5 @tj tj committed Aug 3, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/middleware/logger.js
View
4 lib/middleware/logger.js
@@ -135,7 +135,9 @@ exports = module.exports = function logger(options) {
res.end = function(chunk, encoding){
res.end = end;
res.end(chunk, encoding);
- stream.write(fmt(exports, req, res) + '\n', 'ascii');
+ var line = fmt(exports, req, res);
+ if (null == line) return;
+ stream.write(line + '\n', 'ascii');
};
next();

0 comments on commit 07753e7

Please sign in to comment.