diff options
Diffstat (limited to 'lib/utils/npm-registry-client/request.js')
-rw-r--r-- | lib/utils/npm-registry-client/request.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/utils/npm-registry-client/request.js b/lib/utils/npm-registry-client/request.js index d5122629d..2ecae9386 100644 --- a/lib/utils/npm-registry-client/request.js +++ b/lib/utils/npm-registry-client/request.js @@ -7,7 +7,7 @@ regRequest.upload = upload var npm = require("../../npm.js") , url = require("url") - , log = require("../log.js") + , log = require("npmlog") , fs = require("graceful-fs") , rm = require("rimraf") , asyncMap = require("slide").asyncMap @@ -47,7 +47,7 @@ function regRequest (method, where, what, etag, nofollow, cb_) { // resolve to a full url on the registry if (!where.match(/^https?:\/\//)) { - log.verbose(where, "raw, before any munging") + log.verbose("url raw", where) var q = where.split("?") where = q.shift() @@ -62,9 +62,9 @@ function regRequest (method, where, what, etag, nofollow, cb_) { return encodeURIComponent(p) }).join("/") if (q) where += "?" + q - log.verbose([registry, where], "url resolving") + log.verbose("url resolving", [registry, where]) where = url.resolve(registry, where) - log.verbose(where, "url resolved") + log.verbose("url resolved", where) } var remote = url.parse(where) @@ -88,7 +88,7 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) { , strictSSL: npm.config.get("strict-ssl") } , headers = opts.headers = {} if (etag) { - log.verbose(etag, "etag") + log.verbose("etag", etag) headers[method === "GET" ? "if-none-match" : "if-match"] = etag } @@ -118,7 +118,7 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) { opts.followRedirect = false } - log.http(remote.href || "/", method) + log.http(method, remote.href || "/") var req = request(opts, requestDone(method, where, cb)) var r = npm.config.get("registry") @@ -137,7 +137,7 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) { function requestDone (method, where, cb) { return function (er, response, data) { if (er) return cb(er) - log.http(response.statusCode + " " + url.parse(where).href) + log.http(response.statusCode, url.parse(where).href) var parsed @@ -150,8 +150,8 @@ function requestDone (method, where, cb) { return function (er, response, data) parsed = JSON.parse(data) } catch (ex) { ex.message += "\n" + data - log.verbose(data, "bad json") - log.error("error parsing json", "registry") + log.verbose("bad json", data) + log.error("registry", "error parsing json") return cb(ex, null, data, response) } } else if (data) { |