Skip to content

Commit

Permalink
Improve timer helper output
Browse files Browse the repository at this point in the history
  • Loading branch information
ixti committed May 16, 2012
1 parent 5047ce3 commit da31335
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/mincer/common.js
Expand Up @@ -101,7 +101,7 @@ module.exports.timer = function () {
return {
start: Date.now(),
stop: function () {
return '(' + parseInt((this.start - Date.now()) / 1000, 10) + 'ms)';
return ' (' + parseInt((this.start - Date.now()) / 1000, 10) + 'ms)';
}
};
};
8 changes: 4 additions & 4 deletions lib/mincer/server.js
Expand Up @@ -225,27 +225,27 @@ Server.prototype.handle = function (req, res) {
if (err) {
logger.error(msg_prefix + "Error compiling asset " + pathname);
logger.error(msg_prefix + (err.message || err.toString()));
logger.info(msg_prefix + "500 Application Error " + timer.stop());
logger.info(msg_prefix + "500 Application Error" + timer.stop());
end(res, 500);
return;
}

// asset not found
if (!asset) {
logger.info(msg_prefix + "404 Not found " + timer.stop());
logger.info(msg_prefix + "404 Not found" + timer.stop());
end(res, 404);
return;
}

// Not modified
if (is_etag_match(req, asset)) {
logger.info(msg_prefix + "304 Not Modified " + timer.stop());
logger.info(msg_prefix + "304 Not Modified" + timer.stop());
end(res, 304);
return;
}

// OK
logger.info(msg_prefix + "200 OK " + timer.stop());
logger.info(msg_prefix + "200 OK" + timer.stop());

//
// Ranges are not supported yet
Expand Down

0 comments on commit da31335

Please sign in to comment.