{"action":"created","comment":{"url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments/49577962","id":49577962,"diff_hunk":"@@ -24,6 +24,16 @@ client.on('error', function(e) {\n })\n ```\n \n+Use the `log()` method to log arbitrary data, which can then be logged or displayed by a reporter:\n+```js\n+client\n+    .init()\n+    .log('Before my method')\n+    .click('h2.subheading a')\n+    .log('After my method', {more: 'data'})","path":"docs/guide/usage/eventhandling.md","position":null,"original_position":23,"commit_id":"6b72c9adb7a267de9152ac235b764b025a8463f1","original_commit_id":"c942b926245651cb0f71fe61f5512d002fc8ccb7","user":{"login":"georgecrawford","id":84737,"avatar_url":"https://avatars.githubusercontent.com/u/84737?v=3","gravatar_id":"","url":"https://api.github.com/users/georgecrawford","html_url":"https://github.com/georgecrawford","followers_url":"https://api.github.com/users/georgecrawford/followers","following_url":"https://api.github.com/users/georgecrawford/following{/other_user}","gists_url":"https://api.github.com/users/georgecrawford/gists{/gist_id}","starred_url":"https://api.github.com/users/georgecrawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgecrawford/subscriptions","organizations_url":"https://api.github.com/users/georgecrawford/orgs","repos_url":"https://api.github.com/users/georgecrawford/repos","events_url":"https://api.github.com/users/georgecrawford/events{/privacy}","received_events_url":"https://api.github.com/users/georgecrawford/received_events","type":"User","site_admin":false},"body":"Good catch - thanks.","created_at":"2016-01-13T11:17:10Z","updated_at":"2016-01-13T11:17:10Z","html_url":"https://github.com/webdriverio/webdriverio/pull/1020#discussion_r49577962","pull_request_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020","_links":{"self":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments/49577962"},"html":{"href":"https://github.com/webdriverio/webdriverio/pull/1020#discussion_r49577962"},"pull_request":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020"}}},"pull_request":{"url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020","id":55776543,"html_url":"https://github.com/webdriverio/webdriverio/pull/1020","diff_url":"https://github.com/webdriverio/webdriverio/pull/1020.diff","patch_url":"https://github.com/webdriverio/webdriverio/pull/1020.patch","issue_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1020","number":1020,"state":"open","locked":false,"title":"Emit log lines using browser, and add to reporter stats","user":{"login":"georgecrawford","id":84737,"avatar_url":"https://avatars.githubusercontent.com/u/84737?v=3","gravatar_id":"","url":"https://api.github.com/users/georgecrawford","html_url":"https://github.com/georgecrawford","followers_url":"https://api.github.com/users/georgecrawford/followers","following_url":"https://api.github.com/users/georgecrawford/following{/other_user}","gists_url":"https://api.github.com/users/georgecrawford/gists{/gist_id}","starred_url":"https://api.github.com/users/georgecrawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/georgecrawford/subscriptions","organizations_url":"https://api.github.com/users/georgecrawford/orgs","repos_url":"https://api.github.com/users/georgecrawford/repos","events_url":"https://api.github.com/users/georgecrawford/events{/privacy}","received_events_url":"https://api.github.com/users/georgecrawford/received_events","type":"User","site_admin":false},"body":"This enables a user to add useful information to the test output available to a runner:\r\n```js\r\n\r\n\tbrowser.addCommand('getSectionTitle', function () {\r\n\t\tbrowser.emit('log', 'getSectionTitle log line');\r\n\t\treturn browser.getText(articleSectionTitleSelector).toLowerCase();\r\n\t});\r\n\r\n\tit('should throw an error', function() {\r\n\t\tbrowser.emit('log', 'before log');\r\n\t\tbrowser.emit('log', {complex: 'george'});\r\n\t\tbrowser.getSectionTitle();\r\n\t});\r\n```\r\nFor example, it can be displayed in the debug log output using the Allure reporter:\r\n![screenshot 2016-01-12 15 54 24](https://cloud.githubusercontent.com/assets/84737/12268469/de9c13fa-b944-11e5-91b3-acf140022d32.png)\r\n","created_at":"2016-01-12T15:55:42Z","updated_at":"2016-01-13T11:17:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe9b397c3f3d936258d62dd47916c605bc5eadfd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020/commits","review_comments_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020/comments","review_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/1020/comments","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/6b72c9adb7a267de9152ac235b764b025a8463f1","head":{"label":"webdriverio:browser-emit-log","ref":"browser-emit-log","sha":"6b72c9adb7a267de9152ac235b764b025a8463f1","user":{"login":"webdriverio","id":6512473,"avatar_url":"https://avatars.githubusercontent.com/u/6512473?v=3","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"repo":{"id":2296970,"name":"webdriverio","full_name":"webdriverio/webdriverio","owner":{"login":"webdriverio","id":6512473,"avatar_url":"https://avatars.githubusercontent.com/u/6512473?v=3","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webdriverio/webdriverio","description":"Webdriver/Selenium 2.0 JavaScript bindings for Node.js","fork":false,"url":"https://api.github.com/repos/webdriverio/webdriverio","forks_url":"https://api.github.com/repos/webdriverio/webdriverio/forks","keys_url":"https://api.github.com/repos/webdriverio/webdriverio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webdriverio/webdriverio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webdriverio/webdriverio/teams","hooks_url":"https://api.github.com/repos/webdriverio/webdriverio/hooks","issue_events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/events{/number}","events_url":"https://api.github.com/repos/webdriverio/webdriverio/events","assignees_url":"https://api.github.com/repos/webdriverio/webdriverio/assignees{/user}","branches_url":"https://api.github.com/repos/webdriverio/webdriverio/branches{/branch}","tags_url":"https://api.github.com/repos/webdriverio/webdriverio/tags","blobs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webdriverio/webdriverio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/refs{/sha}","trees_url":"https://api.github.com/repos/webdriverio/webdriverio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/{sha}","languages_url":"https://api.github.com/repos/webdriverio/webdriverio/languages","stargazers_url":"https://api.github.com/repos/webdriverio/webdriverio/stargazers","contributors_url":"https://api.github.com/repos/webdriverio/webdriverio/contributors","subscribers_url":"https://api.github.com/repos/webdriverio/webdriverio/subscribers","subscription_url":"https://api.github.com/repos/webdriverio/webdriverio/subscription","commits_url":"https://api.github.com/repos/webdriverio/webdriverio/commits{/sha}","git_commits_url":"https://api.github.com/repos/webdriverio/webdriverio/git/commits{/sha}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/comments{/number}","issue_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments{/number}","contents_url":"https://api.github.com/repos/webdriverio/webdriverio/contents/{+path}","compare_url":"https://api.github.com/repos/webdriverio/webdriverio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webdriverio/webdriverio/merges","archive_url":"https://api.github.com/repos/webdriverio/webdriverio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webdriverio/webdriverio/downloads","issues_url":"https://api.github.com/repos/webdriverio/webdriverio/issues{/number}","pulls_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls{/number}","milestones_url":"https://api.github.com/repos/webdriverio/webdriverio/milestones{/number}","notifications_url":"https://api.github.com/repos/webdriverio/webdriverio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/labels{/name}","releases_url":"https://api.github.com/repos/webdriverio/webdriverio/releases{/id}","created_at":"2011-08-30T19:02:35Z","updated_at":"2016-01-13T06:20:52Z","pushed_at":"2016-01-13T11:17:04Z","git_url":"git://github.com/webdriverio/webdriverio.git","ssh_url":"git@github.com:webdriverio/webdriverio.git","clone_url":"https://github.com/webdriverio/webdriverio.git","svn_url":"https://github.com/webdriverio/webdriverio","homepage":"www.webdriver.io","size":124266,"stargazers_count":1478,"watchers_count":1478,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":354,"mirror_url":null,"open_issues_count":67,"forks":354,"open_issues":67,"watchers":1478,"default_branch":"master"}},"base":{"label":"webdriverio:v4.0","ref":"v4.0","sha":"efa1f473fecd42e877aee9e96dde230a03a266bc","user":{"login":"webdriverio","id":6512473,"avatar_url":"https://avatars.githubusercontent.com/u/6512473?v=3","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"repo":{"id":2296970,"name":"webdriverio","full_name":"webdriverio/webdriverio","owner":{"login":"webdriverio","id":6512473,"avatar_url":"https://avatars.githubusercontent.com/u/6512473?v=3","gravatar_id":"","url":"https://api.github.com/users/webdriverio","html_url":"https://github.com/webdriverio","followers_url":"https://api.github.com/users/webdriverio/followers","following_url":"https://api.github.com/users/webdriverio/following{/other_user}","gists_url":"https://api.github.com/users/webdriverio/gists{/gist_id}","starred_url":"https://api.github.com/users/webdriverio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/webdriverio/subscriptions","organizations_url":"https://api.github.com/users/webdriverio/orgs","repos_url":"https://api.github.com/users/webdriverio/repos","events_url":"https://api.github.com/users/webdriverio/events{/privacy}","received_events_url":"https://api.github.com/users/webdriverio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/webdriverio/webdriverio","description":"Webdriver/Selenium 2.0 JavaScript bindings for Node.js","fork":false,"url":"https://api.github.com/repos/webdriverio/webdriverio","forks_url":"https://api.github.com/repos/webdriverio/webdriverio/forks","keys_url":"https://api.github.com/repos/webdriverio/webdriverio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/webdriverio/webdriverio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/webdriverio/webdriverio/teams","hooks_url":"https://api.github.com/repos/webdriverio/webdriverio/hooks","issue_events_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/events{/number}","events_url":"https://api.github.com/repos/webdriverio/webdriverio/events","assignees_url":"https://api.github.com/repos/webdriverio/webdriverio/assignees{/user}","branches_url":"https://api.github.com/repos/webdriverio/webdriverio/branches{/branch}","tags_url":"https://api.github.com/repos/webdriverio/webdriverio/tags","blobs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/webdriverio/webdriverio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/webdriverio/webdriverio/git/refs{/sha}","trees_url":"https://api.github.com/repos/webdriverio/webdriverio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/webdriverio/webdriverio/statuses/{sha}","languages_url":"https://api.github.com/repos/webdriverio/webdriverio/languages","stargazers_url":"https://api.github.com/repos/webdriverio/webdriverio/stargazers","contributors_url":"https://api.github.com/repos/webdriverio/webdriverio/contributors","subscribers_url":"https://api.github.com/repos/webdriverio/webdriverio/subscribers","subscription_url":"https://api.github.com/repos/webdriverio/webdriverio/subscription","commits_url":"https://api.github.com/repos/webdriverio/webdriverio/commits{/sha}","git_commits_url":"https://api.github.com/repos/webdriverio/webdriverio/git/commits{/sha}","comments_url":"https://api.github.com/repos/webdriverio/webdriverio/comments{/number}","issue_comment_url":"https://api.github.com/repos/webdriverio/webdriverio/issues/comments{/number}","contents_url":"https://api.github.com/repos/webdriverio/webdriverio/contents/{+path}","compare_url":"https://api.github.com/repos/webdriverio/webdriverio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/webdriverio/webdriverio/merges","archive_url":"https://api.github.com/repos/webdriverio/webdriverio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/webdriverio/webdriverio/downloads","issues_url":"https://api.github.com/repos/webdriverio/webdriverio/issues{/number}","pulls_url":"https://api.github.com/repos/webdriverio/webdriverio/pulls{/number}","milestones_url":"https://api.github.com/repos/webdriverio/webdriverio/milestones{/number}","notifications_url":"https://api.github.com/repos/webdriverio/webdriverio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/webdriverio/webdriverio/labels{/name}","releases_url":"https://api.github.com/repos/webdriverio/webdriverio/releases{/id}","created_at":"2011-08-30T19:02:35Z","updated_at":"2016-01-13T06:20:52Z","pushed_at":"2016-01-13T11:17:04Z","git_url":"git://github.com/webdriverio/webdriverio.git","ssh_url":"git@github.com:webdriverio/webdriverio.git","clone_url":"https://github.com/webdriverio/webdriverio.git","svn_url":"https://github.com/webdriverio/webdriverio","homepage":"www.webdriver.io","size":124266,"stargazers_count":1478,"watchers_count":1478,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":354,"mirror_url":null,"open_issues_count":67,"forks":354,"open_issues":67,"watchers":1478,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020"},"html":{"href":"https://github.com/webdriverio/webdriverio/pull/1020"},"issue":{"href":"https://api.github.com/repos/webdriverio/webdriverio/issues/1020"},"comments":{"href":"https://api.github.com/repos/webdriverio/webdriverio/issues/1020/comments"},"review_comments":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020/comments"},"review_comment":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/webdriverio/webdriverio/pulls/1020/commits"},"statuses":{"href":"https://api.github.com/repos/webdriverio/webdriverio/statuses/6b72c9adb7a267de9152ac235b764b025a8463f1"}}}}