Skip to content
Permalink
Browse files

[fix] Properly observe the `-s|--silent` option for request logging. …

…Bug in #44.
  • Loading branch information...
indexzero committed Dec 6, 2013
1 parent a8d4a8b commit 2b0b55920875d99f6033634b0c9c0fff3f02a8a2
Showing with 5 additions and 6 deletions.
  1. +5 −6 bin/http-server
@@ -29,12 +29,11 @@ var port = argv.p,
log = (argv.s || argv.silent) ? (function () {}) : console.log,
requestLogger;

if (log) {
requestLogger = function(req) {
var d = new Date();
log('[%s] "%s %s" "%s"', (new Date).toUTCString(), req.method.cyan, req.url.cyan, req.headers['user-agent']);
}
}
if (!argv.s && !argv.silent) {
requestLogger = function(req) {
log('[%s] "%s %s" "%s"', (new Date).toUTCString(), req.method.cyan, req.url.cyan, req.headers['user-agent']);
}
}

if (!argv.p) {
portfinder.basePort = 8080;

0 comments on commit 2b0b559

Please sign in to comment.
You can’t perform that action at this time.