fixing up log entries
[nodejs-repoproxy.git] / lib / router.js
index 63622f7..5767d26 100644 (file)
@@ -6,9 +6,9 @@ var log = require("./log.js");
 
 exports.routeRequest = function(req, res) {
        // first, unify the request
-       console.log("request: ", req.url);
+       log.debug("request: ", req.url);
        var thisQuery = unifyRequest(req, res, function(unified) {
-               console.log("unified request is ", unified);
+               log.debug("unified request is ", unified);
                if(unified.requestFor == "/favicon.ico") {
                        unified.b.writeHead(404, {"Content-Type": "text/plain"});
                        unified.b.write("404 Not Found\n");
@@ -20,12 +20,12 @@ exports.routeRequest = function(req, res) {
                        } else if(unified.isDirectory) {
                                cache.serviceDirectory(unified);
                        } else {
-                               console.log("ERROR: something went majorly wrong with something, ", unified);
+                               log.debug("ERROR: something went majorly wrong with something, ", unified);
                        }
                } else {
                        // it doesnt exist yet, so we send it to the cache service if it matches an upstream service
                        if(typeof global.repoproxy.repo[unified.topPath] != "undefined") {
-                               console.log("file doesnt exist, upstream we go: ", unified);
+                               log.debug("file doesnt exist, upstream we go: ", unified);
                                cache.upstreamRequest(unified);
                        } else {
                                unified.b.writeHead(404, {"Content-Type": "text/plain"});