I couldn't find any documentation saying that this already exists, but it would be useful. Would it be possible in a near-future version to be able to specify an io.Writer to which the javascript console log output is written to? Now it goes to stdout or stderr. I'd like to be able to specify a file or null device (to disable console logging) in my application as it pollutes the console.
I could possibly put together a PR to implement such feature. It looks like the main culprit is lines 272-273 in chrome.go where the read loop gets a console call or exception and logs it using the standard logger.
I suppose the way to do this would be to accept an io.Writer somewhere when lorca is setup, create a custom logger with that writer, and then log with that instead of the standard logger.
I couldn't find any documentation saying that this already exists, but it would be useful. Would it be possible in a near-future version to be able to specify an
io.Writer
to which the javascript console log output is written to? Now it goes to stdout or stderr. I'd like to be able to specify a file or null device (to disable console logging) in my application as it pollutes the console.I could possibly put together a PR to implement such feature. It looks like the main culprit is lines 272-273 in
chrome.go
where the read loop gets a console call or exception and logs it using the standard logger.I suppose the way to do this would be to accept an
io.Writer
somewhere when lorca is setup, create a custom logger with that writer, and then log with that instead of the standard logger.