Skip to content

Commit

Permalink
[fix] Properly observe the -s|--silent option for request logging. …
Browse files Browse the repository at this point in the history
…Bug in #44.
  • Loading branch information
indexzero committed Dec 6, 2013
1 parent a8d4a8b commit 2b0b559
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions bin/http-server
Expand Up @@ -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;
Expand Down

0 comments on commit 2b0b559

Please sign in to comment.