nodeca/navit

Debug logging?

Closed this issue · 5 comments

nylen commented

nightmare has nice debug logging:

$ DEBUG=nightmare npm test

[ ... ]
  nightmare queueing action "use" +0ms
  nightmare queueing action "type" +1ms
  nightmare queueing action "type" +0ms
  nightmare queueing action "click" +0ms
  nightmare queueing action "wait" +0ms
  nightmare queueing action "use" +0ms
  nightmare queueing action "use" +0ms
  nightmare queueing action "use" +0ms
  nightmare queueing action "evaluate" +0ms
  nightmare queueing action "click" +1ms
  nightmare queueing action "wait" +0ms
  nightmare queueing action "use" +0ms
  nightmare queueing action "use" +0ms
  nightmare queueing action "evaluate" +0ms
  nightmare run +0ms
  nightmare .setup() creating phantom instance with options {"timeout":5000,"interval":50,"weak":true,"loadImages":true,"ignoreSslErrors":true,"sslProtocol":"any","proxy":null,"proxyType":null,"proxyAuth":null,"cookiesFile":null,"webSecurity":true} +0ms
  nightmare .setup() phantom instance created +4s
  nightmare .setup() phantom page created +9ms
  nightmare .use()-ing a plugin +2ms
  nightmare queueing action "on" +1ms
  nightmare queueing action "goto" +0ms
  nightmare .goto() url: https://mysite.com.com/wp-login.php?redirect_to=whatever +2ms
^C

etc.

Any plans to support similar in navit?

I have no objections against this feature, but we had no need to implement it.

Could you explain when such debug messages can be useful?

nylen commented

I have a quite long sequence of actions and I would like to be able to see what the browser is doing at a given point in time in case something fails. I did not paste the part where the browser is actually doing things, but you also get the debug messages during "real" execution, with timing information. npm package debug makes this pretty easy to implement: https://www.npmjs.com/package/debug#millisecond-diff

I know about debug. Question is what exactly needs to be traced.

Is it ok to place logs for each step execution or more details needed? Original example from your post has queueing info, looks a bit useless... IMHO only execution traces make sence. What do you think?

nylen commented

I agree that execution trace is useful (for each step of execution) and queueing trace is not useful.

Done