Download / ulog

The universal logger
https://ulog.js.org
MIT License
88 stars 19 forks source link

tests contains inadvertent config properties #59

Open Messj1 opened 3 years ago

Messj1 commented 3 years ago

@Download This error seems to be a problem in the test case. The config of ulog contains {log: 'pass'} so the log level become NaN which is true :grin:

The question now: Why are the configs log and test either 'ok' or 'pass'?

I added some console outputs in mods/config/index.js:

update: function(ulog) {
  ...
  var changed = update(ulog.config, newCfg)
  console.log("changed: ", changed);
  ...
},

...

after: function (logger) {
  console.log("after [logger.level]: ", logger.level);
  config.update(this);
  console.log("after [logger.level]: ", logger.level);
}

Console output:

after [logger.level]:  3
changed:  [
  { name: 'test', old: 'ok', new: 'pass' },
  { name: 'log', new: 'pass' },
  { name: 'log_output', new: 'console;test=drain' }
]
after [logger.level]:  NaN

Originally posted by @Messj1 in https://github.com/Download/ulog/issues/58#issuecomment-813024640

Download commented 3 years ago

My idea was to test mods completely independent from ulog itself. But I have not been very consistent about this.