Reputation: 137
I'm using protractor and winston together would like to pass in my winston logging level using the protractor --params option but it seems that if any word on in the command line arguments to protractor send it into debug.
For example I am trying to do the following
protractor conf.js --params.log_level 'debug'
Which sends me into protractor debug mode...
[08:28:26] I/hosted - Using the selenium server at http://localhost:4444/wd/hub
[08:28:26] I/launcher - Running 1 instances of WebDriver
Starting debugger agent.
Debugger listening on port 5858
connecting to localhost:5858 ... ok
break in timers.js:156
154 }
155
>156 function listOnTimeout() {
157 var list = this._list;
158 var msecs = list.msecs;
debug>
My question is two fold.
Is this a bug in protractor that should be filed?
Is there a better way to do this that avoids this possible conflict? My idea was to use winston in the following way, which does work for all log levels passed in except 'debug'.
const winston = require('winston');
winston.level = browser.params['log_level']
Upvotes: 0
Views: 66
Reputation: 10665
This is probably the result of node itself picking 'debug' from the list of args. I don't think is it a bug since this is specified behavior of nodejs, see the node debugger documentation.
Maybe you can solve it by using an alternative notation for the command line parameters, I do think the following should work as well:
--params.log_level=debug
(updated to include reference to node debug, instead of protractor which I previously believed to pick up the debug command)
Upvotes: 3