busterjs/buster

util.print deprecation warnings appearing in reporter output. Replace with console.log.

GCheung55 opened this issue · 9 comments

node@0.12 is deprecating util.print: https://nodejs.org/api/util.html#util_util_print

Thoughts on replacing util.print with console.log?

Seeing plenty of these myself... I'm not sure console.log is the way to go - my guess is that util.print was used, because console is hijacked during test runs to intercept the messages? So, probably a correct alternative might be to hook into process.stdout.

I can swap with process.stdout. Do you think a fallback to console.log would be necessary in case process is undefined?

On May 12, 2015, at 1:33 PM, Dominykas Blyžė notifications@github.com wrote:

Seeing plenty of these myself... I'm not sure console.log is the way to go - my guess is that util.print was used, because console is hijacked during test runs to intercept the messages? So, probably a correct alternative might be to hook into process.stdout.


Reply to this email directly or view it on GitHub.

Can the process even be undefined? If there's util.print, I assume it's node code, therefore process should be also there. Either way, when I last looked at this, there was some other issue, but I can't recall... maybe sync/async problems... maybe something else. This needs a little bit of doc reading/research to list out what are the differences between the three things (util, console and stdout).

Perhaps we can use util.log instead?

On May 13, 2015, at 2:16 AM, Dominykas Blyžė notifications@github.com wrote:

Can the process even be undefined? If there's util.print, I assume it's node code, therefore process should be also there. Either way, when I last looked at this, there was some other issue, but I can't recall... maybe sync/async problems... maybe something else. This needs a little bit of doc reading/research to list out what are the differences between the three things (util, console and stdout).


Reply to this email directly or view it on GitHub.

Docs say util.log will have a timestamp prepended... I'd say stdout approach is better, as you mentioned on IRC. I just really don't remember what was the problem with it :)

I've switched to using process.stdout.

On May 14, 2015, at 12:44 AM, Dominykas Blyžė notifications@github.com wrote:

Docs say util.log will have a timestamp prepended... I'd say stdout approach is better, as you mentioned on IRC. I just really don't remember what was the problem with it :)


Reply to this email directly or view it on GitHub.

@augustl, @dwittner, @cjohansen: Thoughts on the change?

I'm all for it - no commit rights, though :)

@GCheung55 , version 0.7.13 of buster-test is released. Please check it.