{"action":"opened","issue":{"url":"https://api.github.com/repos/scrapinghub/splash/issues/176","labels_url":"https://api.github.com/repos/scrapinghub/splash/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/scrapinghub/splash/issues/176/comments","events_url":"https://api.github.com/repos/scrapinghub/splash/issues/176/events","html_url":"https://github.com/scrapinghub/splash/issues/176","id":56568095,"number":176,"title":"console.log only logs its first argument","user":{"login":"mehaase","id":320904,"avatar_url":"https://avatars.githubusercontent.com/u/320904?v=3","gravatar_id":"","url":"https://api.github.com/users/mehaase","html_url":"https://github.com/mehaase","followers_url":"https://api.github.com/users/mehaase/followers","following_url":"https://api.github.com/users/mehaase/following{/other_user}","gists_url":"https://api.github.com/users/mehaase/gists{/gist_id}","starred_url":"https://api.github.com/users/mehaase/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mehaase/subscriptions","organizations_url":"https://api.github.com/users/mehaase/orgs","repos_url":"https://api.github.com/users/mehaase/repos","events_url":"https://api.github.com/users/mehaase/events{/privacy}","received_events_url":"https://api.github.com/users/mehaase/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-04T18:36:05Z","updated_at":"2015-02-04T18:36:05Z","closed_at":null,"body":"If a user tries to `console.log(…)` multiple arguments, only the first argument is actually written to the Splash log (using `-v 2` verbosity). Here's an example:\r\n\r\n    function main(splash)\r\n        splash:runjs(\"console.log('one','two','three')\")\r\n        return {ok='ok'}\r\n    end\r\n\r\nI would expect to see all three strings written to the Splash log, but in fact only one string is written:\r\n\r\n    2015-02-04 13:26:51.412126 [render] JsConsole(:1): one\r\n\r\nNow, `console.log(…)` is _not an ECMA standard_, but the WebKit implementation is variadic, so its surprising that Splash implementation is not. (For what it's worth, the [Mozilla implementation](https://developer.mozilla.org/en-US/docs/Web/API/Console.log) is also variadic.)\r\n\r\nThe [QT signature for this method](http://qt-project.org/doc/qt-4.8/qwebpage.html#javaScriptConsoleMessage) only takes a single string argument,which is no doubt why Splash also takes a single string argument. So it might seem hopeless to hope for variadic `console.log(…)` in Splash, but `browser_tab.py` actually includes a custom implementation of `console.log(…)` that is disabled by default. \r\n\r\nMaybe it should be enabled full time (still logging at `-v 2` level)  and also improved to take variadic arguments?"}}