{"action":"created","comment":{"url":"https://api.github.com/repos/youtube/vitess/pulls/comments/26126281","id":26126281,"diff_hunk":"@@ -150,50 +154,47 @@ func (stats *SQLQueryStats) FmtQuerySources() string {\n \treturn strings.Join(sources[:n], \",\")\n }\n \n-func (log *SQLQueryStats) RemoteAddr() string {\n-\treturn callinfo.FromContext(log.context).RemoteAddr()\n-}\n-\n-func (log *SQLQueryStats) Username() string {\n-\treturn callinfo.FromContext(log.context).Username()\n-}\n-\n-func (log *SQLQueryStats) ContextHTML() template.HTML {\n-\treturn callinfo.FromContext(log.context).HTML()\n-}\n-\n-func (log *SQLQueryStats) ErrorStr() string {\n-\tif log.Error != nil {\n-\t\treturn log.Error.Error()\n+// ErrorStr returns the error string or \"\"\n+func (stats *SQLQueryStats) ErrorStr() string {\n+\tif stats.Error != nil {\n+\t\treturn stats.Error.Error()\n \t}\n \treturn \"\"\n }\n \n-// String returns a tab separated list of logged fields.\n-func (log *SQLQueryStats) Format(params url.Values) string {\n+// Format returns a tab separated list of logged fields.\n+func (stats *SQLQueryStats) Format(params url.Values) string {\n \t_, fullBindParams := params[\"full\"]\n+\n+\tremoteAddr := \"\"\n+\tusername := \"\"\n+\tci, ok := callinfo.FromContext(stats.context)\n+\tif ok {\n+\t\tremoteAddr = ci.RemoteAddr\n+\t\tusername = ci.Username\n+\t}\n \treturn fmt.Sprintf(\n \t\t\"%v\\t%v\\t%v\\t%v\\t%v\\t%.6f\\t%v\\t%q\\t%v\\t%v\\t%q\\t%v\\t%.6f\\t%.6f\\t%v\\t%v\\t%v\\t%v\\t%v\\t%v\\t%q\\t\\n\",\n-\t\tlog.Method,\n-\t\tlog.RemoteAddr(),\n-\t\tlog.Username(),\n-\t\tlog.StartTime.Format(time.StampMicro),\n-\t\tlog.EndTime.Format(time.StampMicro),\n-\t\tlog.TotalTime().Seconds(),\n-\t\tlog.PlanType,\n-\t\tlog.OriginalSql,\n-\t\tlog.FmtBindVariables(fullBindParams),\n-\t\tlog.NumberOfQueries,\n-\t\tlog.RewrittenSql(),\n-\t\tlog.FmtQuerySources(),\n-\t\tlog.MysqlResponseTime.Seconds(),\n-\t\tlog.WaitingForConnection.Seconds(),\n-\t\tlog.RowsAffected,\n-\t\tlog.SizeOfResponse(),\n-\t\tlog.CacheHits,\n-\t\tlog.CacheMisses,\n-\t\tlog.CacheAbsent,\n-\t\tlog.CacheInvalidations,\n-\t\tlog.ErrorStr(),\n+\t\tstats.Method,\n+\t\tremoteAddr,","path":"go/vt/tabletserver/streamlogger.go","position":111,"original_position":111,"commit_id":"5af47a5d25d5dcd0174b6ab93f2b94181b0ca00e","original_commit_id":"5af47a5d25d5dcd0174b6ab93f2b94181b0ca00e","user":{"login":"alainjobart","id":4625714,"avatar_url":"https://avatars.githubusercontent.com/u/4625714?v=3","gravatar_id":"","url":"https://api.github.com/users/alainjobart","html_url":"https://github.com/alainjobart","followers_url":"https://api.github.com/users/alainjobart/followers","following_url":"https://api.github.com/users/alainjobart/following{/other_user}","gists_url":"https://api.github.com/users/alainjobart/gists{/gist_id}","starred_url":"https://api.github.com/users/alainjobart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alainjobart/subscriptions","organizations_url":"https://api.github.com/users/alainjobart/orgs","repos_url":"https://api.github.com/users/alainjobart/repos","events_url":"https://api.github.com/users/alainjobart/events{/privacy}","received_events_url":"https://api.github.com/users/alainjobart/received_events","type":"User","site_admin":false},"body":"Why? there is no change here, really. RemoteAddr() and Username would just return \"\" if there was no context before. So it's just the exact same result as before... Or am I missing something?","created_at":"2015-03-10T14:32:24Z","updated_at":"2015-03-10T14:32:24Z","html_url":"https://github.com/youtube/vitess/pull/460#discussion_r26126281","pull_request_url":"https://api.github.com/repos/youtube/vitess/pulls/460","_links":{"self":{"href":"https://api.github.com/repos/youtube/vitess/pulls/comments/26126281"},"html":{"href":"https://github.com/youtube/vitess/pull/460#discussion_r26126281"},"pull_request":{"href":"https://api.github.com/repos/youtube/vitess/pulls/460"}}},"pull_request":{"url":"https://api.github.com/repos/youtube/vitess/pulls/460","id":30765812,"html_url":"https://github.com/youtube/vitess/pull/460","diff_url":"https://github.com/youtube/vitess/pull/460.diff","patch_url":"https://github.com/youtube/vitess/pull/460.patch","issue_url":"https://api.github.com/repos/youtube/vitess/issues/460","number":460,"state":"open","locked":false,"title":"Updating CallInfo to be more in line with Context API.","user":{"login":"alainjobart","id":4625714,"avatar_url":"https://avatars.githubusercontent.com/u/4625714?v=3","gravatar_id":"","url":"https://api.github.com/users/alainjobart","html_url":"https://github.com/alainjobart","followers_url":"https://api.github.com/users/alainjobart/followers","following_url":"https://api.github.com/users/alainjobart/following{/other_user}","gists_url":"https://api.github.com/users/alainjobart/gists{/gist_id}","starred_url":"https://api.github.com/users/alainjobart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alainjobart/subscriptions","organizations_url":"https://api.github.com/users/alainjobart/orgs","repos_url":"https://api.github.com/users/alainjobart/repos","events_url":"https://api.github.com/users/alainjobart/events{/privacy}","received_events_url":"https://api.github.com/users/alainjobart/received_events","type":"User","site_admin":false},"body":"And remove all the cast madness.\r\n@sougou @enisoc ","created_at":"2015-03-09T14:40:49Z","updated_at":"2015-03-10T14:32:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2889d43190d354835a372338cd5f0e9c07c92c22","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/youtube/vitess/pulls/460/commits","review_comments_url":"https://api.github.com/repos/youtube/vitess/pulls/460/comments","review_comment_url":"https://api.github.com/repos/youtube/vitess/pulls/comments{/number}","comments_url":"https://api.github.com/repos/youtube/vitess/issues/460/comments","statuses_url":"https://api.github.com/repos/youtube/vitess/statuses/5af47a5d25d5dcd0174b6ab93f2b94181b0ca00e","head":{"label":"youtube:resharding","ref":"resharding","sha":"5af47a5d25d5dcd0174b6ab93f2b94181b0ca00e","user":{"login":"youtube","id":4052902,"avatar_url":"https://avatars.githubusercontent.com/u/4052902?v=3","gravatar_id":"","url":"https://api.github.com/users/youtube","html_url":"https://github.com/youtube","followers_url":"https://api.github.com/users/youtube/followers","following_url":"https://api.github.com/users/youtube/following{/other_user}","gists_url":"https://api.github.com/users/youtube/gists{/gist_id}","starred_url":"https://api.github.com/users/youtube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youtube/subscriptions","organizations_url":"https://api.github.com/users/youtube/orgs","repos_url":"https://api.github.com/users/youtube/repos","events_url":"https://api.github.com/users/youtube/events{/privacy}","received_events_url":"https://api.github.com/users/youtube/received_events","type":"Organization","site_admin":false},"repo":{"id":11008207,"name":"vitess","full_name":"youtube/vitess","owner":{"login":"youtube","id":4052902,"avatar_url":"https://avatars.githubusercontent.com/u/4052902?v=3","gravatar_id":"","url":"https://api.github.com/users/youtube","html_url":"https://github.com/youtube","followers_url":"https://api.github.com/users/youtube/followers","following_url":"https://api.github.com/users/youtube/following{/other_user}","gists_url":"https://api.github.com/users/youtube/gists{/gist_id}","starred_url":"https://api.github.com/users/youtube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youtube/subscriptions","organizations_url":"https://api.github.com/users/youtube/orgs","repos_url":"https://api.github.com/users/youtube/repos","events_url":"https://api.github.com/users/youtube/events{/privacy}","received_events_url":"https://api.github.com/users/youtube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/youtube/vitess","description":"vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services.","fork":false,"url":"https://api.github.com/repos/youtube/vitess","forks_url":"https://api.github.com/repos/youtube/vitess/forks","keys_url":"https://api.github.com/repos/youtube/vitess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/youtube/vitess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/youtube/vitess/teams","hooks_url":"https://api.github.com/repos/youtube/vitess/hooks","issue_events_url":"https://api.github.com/repos/youtube/vitess/issues/events{/number}","events_url":"https://api.github.com/repos/youtube/vitess/events","assignees_url":"https://api.github.com/repos/youtube/vitess/assignees{/user}","branches_url":"https://api.github.com/repos/youtube/vitess/branches{/branch}","tags_url":"https://api.github.com/repos/youtube/vitess/tags","blobs_url":"https://api.github.com/repos/youtube/vitess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/youtube/vitess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/youtube/vitess/git/refs{/sha}","trees_url":"https://api.github.com/repos/youtube/vitess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/youtube/vitess/statuses/{sha}","languages_url":"https://api.github.com/repos/youtube/vitess/languages","stargazers_url":"https://api.github.com/repos/youtube/vitess/stargazers","contributors_url":"https://api.github.com/repos/youtube/vitess/contributors","subscribers_url":"https://api.github.com/repos/youtube/vitess/subscribers","subscription_url":"https://api.github.com/repos/youtube/vitess/subscription","commits_url":"https://api.github.com/repos/youtube/vitess/commits{/sha}","git_commits_url":"https://api.github.com/repos/youtube/vitess/git/commits{/sha}","comments_url":"https://api.github.com/repos/youtube/vitess/comments{/number}","issue_comment_url":"https://api.github.com/repos/youtube/vitess/issues/comments{/number}","contents_url":"https://api.github.com/repos/youtube/vitess/contents/{+path}","compare_url":"https://api.github.com/repos/youtube/vitess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/youtube/vitess/merges","archive_url":"https://api.github.com/repos/youtube/vitess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/youtube/vitess/downloads","issues_url":"https://api.github.com/repos/youtube/vitess/issues{/number}","pulls_url":"https://api.github.com/repos/youtube/vitess/pulls{/number}","milestones_url":"https://api.github.com/repos/youtube/vitess/milestones{/number}","notifications_url":"https://api.github.com/repos/youtube/vitess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/youtube/vitess/labels{/name}","releases_url":"https://api.github.com/repos/youtube/vitess/releases{/id}","created_at":"2013-06-27T21:20:28Z","updated_at":"2015-03-10T14:09:04Z","pushed_at":"2015-03-10T01:33:07Z","git_url":"git://github.com/youtube/vitess.git","ssh_url":"git@github.com:youtube/vitess.git","clone_url":"https://github.com/youtube/vitess.git","svn_url":"https://github.com/youtube/vitess","homepage":null,"size":63157,"stargazers_count":2159,"watchers_count":2159,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":262,"mirror_url":null,"open_issues_count":12,"forks":262,"open_issues":12,"watchers":2159,"default_branch":"master"}},"base":{"label":"youtube:master","ref":"master","sha":"bcc7186d9e94ec40ff0517fb884ac4eccfa718eb","user":{"login":"youtube","id":4052902,"avatar_url":"https://avatars.githubusercontent.com/u/4052902?v=3","gravatar_id":"","url":"https://api.github.com/users/youtube","html_url":"https://github.com/youtube","followers_url":"https://api.github.com/users/youtube/followers","following_url":"https://api.github.com/users/youtube/following{/other_user}","gists_url":"https://api.github.com/users/youtube/gists{/gist_id}","starred_url":"https://api.github.com/users/youtube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youtube/subscriptions","organizations_url":"https://api.github.com/users/youtube/orgs","repos_url":"https://api.github.com/users/youtube/repos","events_url":"https://api.github.com/users/youtube/events{/privacy}","received_events_url":"https://api.github.com/users/youtube/received_events","type":"Organization","site_admin":false},"repo":{"id":11008207,"name":"vitess","full_name":"youtube/vitess","owner":{"login":"youtube","id":4052902,"avatar_url":"https://avatars.githubusercontent.com/u/4052902?v=3","gravatar_id":"","url":"https://api.github.com/users/youtube","html_url":"https://github.com/youtube","followers_url":"https://api.github.com/users/youtube/followers","following_url":"https://api.github.com/users/youtube/following{/other_user}","gists_url":"https://api.github.com/users/youtube/gists{/gist_id}","starred_url":"https://api.github.com/users/youtube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youtube/subscriptions","organizations_url":"https://api.github.com/users/youtube/orgs","repos_url":"https://api.github.com/users/youtube/repos","events_url":"https://api.github.com/users/youtube/events{/privacy}","received_events_url":"https://api.github.com/users/youtube/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/youtube/vitess","description":"vitess provides servers and tools which facilitate scaling of MySQL databases for large scale web services.","fork":false,"url":"https://api.github.com/repos/youtube/vitess","forks_url":"https://api.github.com/repos/youtube/vitess/forks","keys_url":"https://api.github.com/repos/youtube/vitess/keys{/key_id}","collaborators_url":"https://api.github.com/repos/youtube/vitess/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/youtube/vitess/teams","hooks_url":"https://api.github.com/repos/youtube/vitess/hooks","issue_events_url":"https://api.github.com/repos/youtube/vitess/issues/events{/number}","events_url":"https://api.github.com/repos/youtube/vitess/events","assignees_url":"https://api.github.com/repos/youtube/vitess/assignees{/user}","branches_url":"https://api.github.com/repos/youtube/vitess/branches{/branch}","tags_url":"https://api.github.com/repos/youtube/vitess/tags","blobs_url":"https://api.github.com/repos/youtube/vitess/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/youtube/vitess/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/youtube/vitess/git/refs{/sha}","trees_url":"https://api.github.com/repos/youtube/vitess/git/trees{/sha}","statuses_url":"https://api.github.com/repos/youtube/vitess/statuses/{sha}","languages_url":"https://api.github.com/repos/youtube/vitess/languages","stargazers_url":"https://api.github.com/repos/youtube/vitess/stargazers","contributors_url":"https://api.github.com/repos/youtube/vitess/contributors","subscribers_url":"https://api.github.com/repos/youtube/vitess/subscribers","subscription_url":"https://api.github.com/repos/youtube/vitess/subscription","commits_url":"https://api.github.com/repos/youtube/vitess/commits{/sha}","git_commits_url":"https://api.github.com/repos/youtube/vitess/git/commits{/sha}","comments_url":"https://api.github.com/repos/youtube/vitess/comments{/number}","issue_comment_url":"https://api.github.com/repos/youtube/vitess/issues/comments{/number}","contents_url":"https://api.github.com/repos/youtube/vitess/contents/{+path}","compare_url":"https://api.github.com/repos/youtube/vitess/compare/{base}...{head}","merges_url":"https://api.github.com/repos/youtube/vitess/merges","archive_url":"https://api.github.com/repos/youtube/vitess/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/youtube/vitess/downloads","issues_url":"https://api.github.com/repos/youtube/vitess/issues{/number}","pulls_url":"https://api.github.com/repos/youtube/vitess/pulls{/number}","milestones_url":"https://api.github.com/repos/youtube/vitess/milestones{/number}","notifications_url":"https://api.github.com/repos/youtube/vitess/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/youtube/vitess/labels{/name}","releases_url":"https://api.github.com/repos/youtube/vitess/releases{/id}","created_at":"2013-06-27T21:20:28Z","updated_at":"2015-03-10T14:09:04Z","pushed_at":"2015-03-10T01:33:07Z","git_url":"git://github.com/youtube/vitess.git","ssh_url":"git@github.com:youtube/vitess.git","clone_url":"https://github.com/youtube/vitess.git","svn_url":"https://github.com/youtube/vitess","homepage":null,"size":63157,"stargazers_count":2159,"watchers_count":2159,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":262,"mirror_url":null,"open_issues_count":12,"forks":262,"open_issues":12,"watchers":2159,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/youtube/vitess/pulls/460"},"html":{"href":"https://github.com/youtube/vitess/pull/460"},"issue":{"href":"https://api.github.com/repos/youtube/vitess/issues/460"},"comments":{"href":"https://api.github.com/repos/youtube/vitess/issues/460/comments"},"review_comments":{"href":"https://api.github.com/repos/youtube/vitess/pulls/460/comments"},"review_comment":{"href":"https://api.github.com/repos/youtube/vitess/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/youtube/vitess/pulls/460/commits"},"statuses":{"href":"https://api.github.com/repos/youtube/vitess/statuses/5af47a5d25d5dcd0174b6ab93f2b94181b0ca00e"}}}}