Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Inherit log settings from npm. #36

wants to merge 1 commit into from

4 participants


If the optional dependency npmlog happens to be installed, log settings such as color, heading and log-level will be not be inherited from npm's configuration. This PR explicitly tries to inherit log config no matter whether npmlog is installed or not.


actually hang on, there's some weird relationship between npm, npm-registry-client & npmlog, have to investigate more.

@timoxley timoxley closed this
@timoxley timoxley reopened this

Investigated and this seems the most reasonable way of solving the bug in npm/npm#4186

rex commented

Please, please, please can this be merged in? This pull request fixes a long running bug that ignores loglevel settings and I will do a happy dance if I can finally have my console output cleaned up.


This doesn't land cleanly, and seems to make the tests hang.

Is this still an issue?

@isaacs isaacs closed this

@isaacs It honestly is kind of hit-miss. Mostly working just fine, respecting my logging settings, but occasionally it reverts to verbose output. Definitely not something that affects my life significantly, however it is an interesting "ghost in the machine" if you will.


@isaacs I'm still seeing it after having reinstalled node (then it was gone) and then done "npm update -g" (then it reappeared). The thing that makes it extra frustrating is that it's hard to find out exactly what's been updated that I care about amongst all the junk output when I do "npm -g update".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 10, 2014
  1. @timoxley
This page is out of date. Refresh to see the latest.
Showing with 13 additions and 2 deletions.
  1. +13 −2 index.js
15 index.js
@@ -13,7 +13,8 @@ try {
} catch (er) {
npmlog = { error: noop, warn: noop, info: noop,
verbose: noop, silly: noop, http: noop,
- pause: noop, resume: noop }
+ pause: noop, resume: noop,
+ enableColor: noop, disableColor: noop }
function noop () {}
@@ -63,7 +64,17 @@ function RegClient (conf) {
this.couchLogin.key = this.conf.get('key')
- this.log = conf.log || conf.get('log') || npmlog
+ var log = this.log = conf.log || conf.get('log') || npmlog
+ // inherit settings from parent npm
+ log.level = conf.get("loglevel")
+ log.heading = conf.get("heading") || "npm-registry-client"
+ = conf.get("logstream")
+ switch (conf.get("color")) {
+ case "always": log.enableColor(); break
+ case false: log.disableColor(); break
+ }
require('fs').readdirSync(__dirname + "/lib").forEach(function (f) {
Something went wrong with that request. Please try again.