Added config option to enable/disable logging

pull/2/head
Jim Heising 2014-08-22 10:41:36 -07:00
parent fe806d2d7b
commit 9a6293018a
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
exports.port = process.env.PORT || 3000;
exports.enable_logging = false;
exports.fetch_regex = /^\/fetch\/(.*)$/; // The URL to look for when parsing the request.
exports.proxy_request_timeout_ms = 10000; // The lenght of time we'll wait for a proxy server to respond before timing out.
exports.max_request_length = 100000; // The maximum length of characters allowed for a request or a response.

View File

@ -120,7 +120,10 @@ http.createServer(function (req, res) {
var remoteIP = getClientAddress(req);
// Log our request
console.log("%s %s %s", (new Date()).toJSON(), remoteIP, req.method, req.url);
if(config.enable_logging)
{
console.log("%s %s %s", (new Date()).toJSON(), remoteIP, req.method, req.url);
}
if(config.enable_rate_limiting)
{