Revert "Update connect-logger.js to work correctly with express"

This reverts commit d18fb466fb.
This commit is contained in:
Vladimir Mitev 2014-05-26 15:56:23 +03:00
parent 6314e4a344
commit f8b6cc7c39

View File

@ -84,14 +84,6 @@ function getLogger(logger4js, options) {
res.end = end; res.end = end;
res.end(chunk, encoding); res.end(chunk, encoding);
res.responseTime = new Date() - start; res.responseTime = new Date() - start;
//status code response level handling
if(res.statusCode && options.level === 'auto'){
level = levels.INFO;
if(res.statusCode >= 300) level = levels.WARN;
if(res.statusCode >= 400) level = levels.ERROR;
} else {
level = levels.toLevel(options.level, levels.INFO);
}
if (thislogger.isLevelEnabled(level)) { if (thislogger.isLevelEnabled(level)) {
if (typeof fmt === 'function') { if (typeof fmt === 'function') {
var line = fmt(req, res, function(str){ return format(str, req, res); }); var line = fmt(req, res, function(str){ return format(str, req, res); });